Home Download Buy Blog Forum Support

Making a custom .sublime-build

Making a custom .sublime-build

Postby marshall_law on Sun Dec 06, 2009 10:21 pm

Hey guys..

I went about creating a custom .sublime-build file for SCons, since that's the build system we use in our project. I was able to get the build command working easily enough, but I'm having a hard time getting the lineNumberRegex to correctly support double-clickable error messages. I've tested this regex directly in the python shell against generated errors and the groups seem to return what I'm expecting. I'm wondering if the win32-style slashes are possibly the problem (as the errors are actually coming from Visual Studio). Here's my scons.sublime-build file:

Code: Select all
build C:\Python25\Scripts\scons.bat -C "C:\Users\marshall\titanium_desktop" -j 4 debug=1 breakpad=0 webkit_debug=1
lineNumberRegex ^([^\(]+)\(([0-9]+)\)

Following the model of the Make.sublime-build file, I broke up the error message into 2 groups; the first being the file path relative to the project root, and the second being the line number. Given the following error message:

modules\ti.UI\win32\win32_user_window.cpp(23) : error C2143: syntax error : missing ';' before 'constant'

and using re.match, this breaks down to:
group 1: modules\ti.UI\win32\win32_user_window.cpp
group 2: 23

Double clicking the above error message in the sublime output window doesn't seem to have any effect, so I have a few questions:
  • Is the order of the match groups correct? (is it ok to leave out the 3rd / optional "column" group?)
  • Do the win32 style "back slashes" in the relative path affect the logic somehow?
  • Do the paths need to be absolute instead of relative? SCons seems to pass relative (to the mount dir) paths into cl.exe / Visual Studio, which reports them back instead of the absolute path.
  • If any of the above are true, I guess I'd need to programmatically give Sublime the input it expects.. is there any inherit pluggability in the "build" support?
  • Is there any kind of visual indication to differentiate an error in the output window to the rest of the process output? If not -- it would be great if there was a simple red foreground or otherwise configurable option for this, to help differentiate it from other output in the window.

Thanks for a great editor.. looking forward to the day when I can replace the quirky Notepad++...
Posts: 2
Joined: Sun Dec 06, 2009 10:04 pm

Re: Making a custom .sublime-build

Postby marshall_law on Sun Dec 06, 2009 10:37 pm

Turns out I needed to restart Sublime after editing the regex for it to take.. odd :).
Posts: 2
Joined: Sun Dec 06, 2009 10:04 pm

Re: Making a custom .sublime-build

Postby jps on Mon Dec 07, 2009 11:43 am

Yeah, you shouldn't generally have to restart, but on occasion the file changed notification won't get delivered, so Sublime won't recognise that a file has changed.

Also, if you look in the console after double clicking on a build error, I believe it does log some diagnostic information there.
Site Admin
Posts: 3217
Joined: Wed Mar 19, 2008 12:33 pm

Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 22 guests