Sublime Forum

[Solved] Build System annotations



Up until recently, I had a simple build system using only a mybuildsystem.sublime-build file. It had a file_regex entry, which worked fine, and on build errors, it was showing the errors inline in my editor (this is what I mean by “annotations” in the subject, I’m not sure those are called like this in Sublime)

I’m now using a more advance build system using a Python plugin. It’s based on the advanced example:
It works fine, except for 1 thing: it no longer shows the errors inline in my code. I can see the errors in the build output, I can navigate them using the F4 / Shift+F4 shortcuts, but I can’t make the plugin show the annotations.

Is there anything special to do, in order to make the errors show as red inline annotations, in my files?



Have you tried setting Sublime as your default editor through Ubuntu’s settings? Go to Settings > Details > Default Applications and select Sublime Text as your default text editor. If that doesn’t work, you could also try using the xdg-mime command to set Sublime as the default for specific file types. Just run something like xdg-mime default sublime_text.desktop text/plain in the terminal. Hope this helps fix the issue.



The annotations from a build are a feature of the internal exec command that’s used for build systems by default; if you create your own target command then you need to also add in handling to support that as well.

There is an API for gathering the list of errors and for adding the annotations, so you just need to tie them together.

You can see how it works by default by using View Package File from the command palette and opening Default/exec,py.



That’s exactly what I was looking for! Thanks a lot!



Thanks again for the help, worked like a charm (minus the bugs in my build system code :p)
I now have nice inline errors:

1 Like