1 2 3 4 | { "shell_cmd": "build", "file_regex": "^ *([A-z]:.*)[(]([0-9]+)[)]" } |
According to that guide I should be able to cycle between errors with F4. But this requires the file_regex in the build script above to work on the output cl.exe generates. And this is where I hit a wall. The best regex I could write was:
1 | ^(..[A-z0-9_.]*)\n.*[(]([0-9]*) |
which can catch exactly 1 error. The first group catches the file name, the second catches the line number.
Does anyone have a working regex for cl.exe output?
For reference, here is some output of my build:
1 2 3 4 5 6 7 | win32_proceduralmusic.cpp ..\win32_proceduralmusic.cpp(62) : error C2065: 'CS_USEDEFAULT' : undeclared identifier ..\win32_proceduralmusic.cpp(63) : error C2065: 'CS_USEDEFAULT' : undeclared identifier ..\win32_proceduralmusic.cpp(64) : error C2065: 'CS_USEDEFAULT' : undeclared identifier ..\win32_proceduralmusic.cpp(65) : error C2065: 'CS_USEDEFAULT' : undeclared identifier ..\win32_proceduralmusic.cpp(72) : error C2059: syntax error : '=' [Finished in 0.4s] |
EDIT: Getting closer. I randomly deleted part of the regex, and now I'm matching all errors. They also get highlighted. But when I use F4 to cycle between them, It opens a different file which is at W:\in32_proceduralmusic.cpp instead of W:\win32_proceduralmusic.cpp.
1 | (.*)[(]([0-9]*) |