Sublime Forum

Wrong build system navigation

#1

Hello,

I have problem with build system navigation. I have all sublime projects in one folder that is located not even close to my source files, in that folder I am holding build system bat file that do stuff. Sublime gives parameters to that bat file via variants. with regular expression file_regex I get file_name.c or file_name.h and line. When i build my project then sublime opens source file that is in the folder where my sublime projects and bat file are. I cant get full path from error message because it is not full:
…\source_main\SMS\sms_events.c(167): error: #20: identifier “sdsd” is undefined
…\source_main\SMS\sms_events.c(169): error: #65: expected a “;”
…\source_main\SMS\sms_events.c(179): error: #20: identifier “i” is undefined

In sublime build documentation there is result_base_dir setting, but it is not documented on internet.
My question is how to jump to source folder and search file like with (cmd+p) + (cmd+g)? Can I set up result_base_dir and how and where to do that?
Or there is a way to a solution of this problem? I do not known how to write plugins.

0 Likes

#2

result_base_dir is set to the “working_dir” argument of your build file (docs.sublimetext.info/en/latest/ … -arguments).
I suppose that if you set it to the base dir of your error message and use a “file_regex” that match all the path of the file (including …), it must works.

Navigation to the errors are bind to (SHIFT)+F4.

edit:
You can switch on the debug of your regex for the build by typing in the console:

sublime.log_result_regex(True)
0 Likes

#3

Thank you for your answer. I found a way to my solution. I set may working dir where is my code, then when I execute bat file I do it with full path:
“cmd”: “$project_path\universal_builder.bat”],
And it works great :smile:

0 Likes