I work with custom build system in ST3.
My compiler generates me errors something like this:* MyFileName.cpp:413: error: expected ‘;’ before ‘return’*
I want to capture them and navigate to corresponding file and line using F4.
My build system:
{
"shell_cmd": "gmake debug"
,"working_dir": "/Disk/PathToProject"
,"file_regex": "^(.*.cpp):(\\d*): error: (.*)$"
}
Everything works fine, ST3 highlights row with error message in the build log and navigates to corresponding file and row, but only if file is under /PathToProject. If file is for ex. under /PathToProject/Subfolder1 then row with error is highlighted, but ST3 doesn’t navigate to correct file, instead of this it creates an empty file under /PathToProject.
According to doc I should use “line_regex”
Ok, I have in my build log row like this: Entering directory `/Disk/PathToProject/Subfolder1’. And I can easy capture it in file_regex. So my build settings becomes:
{
"shell_cmd": "gmake debug"
,"working_dir": "/Disk/PathToProject"
,"file_regex": "^.*Entering directory `/Disk/PathToProject/(.*)'$"
,"line_regex": "^(.*.cpp):(\\d*): error: (.*)$"
}
My question is: what is the way to concatenate paths from file_regex and line_regex and tell ST3 correctly which file to open when I press F4?
Thank you for your time.