sublime-zig-language
sublime-zig-language copied to clipboard
Build system missing file regex
If you add this after the "selector": "source.zig", line, Sublime 4 is capable of parsing each of the errors and jumping to the line containing it:
"file_regex": "^\\s*([^:]+):(\\d+):(\\d+):\\s*(.*)$",
I wish I had seen this, I fumbled through making the regex myself.
This is a really nice change though, it's very helpful.
Another good one:
"syntax": "Packages/Zig Language/Syntaxes/Zig.tmLanguage"
so the console output has zig syntax highlighting. Some of it is nonsense, but the code around errors is nice to have highlighted IMO.

It looks like it used to have "file_regex" but it was replaced: https://github.com/ziglang/sublime-zig-language/commit/815cffad5168833977c216925ea4b9d8a52ddbef#diff-842da002f0f59f63191c5af5fdc660929b936434bcebbf41d587a9f07dfda017L5
The changes seem based on the Sublime Documentation from here: https://www.sublimetext.com/docs/build_systems.html
That page is the only place I can find a reference to result_file_regex, so I'm wondering if the variable was renamed to file_regex, and that is what is causing this to not work.
which version of sublime text are you using? in previous versions of sublime text they were called file_regex and line_regex, but they were changed to result_file_regex and result_line_regex. in build sublime text build 4121, the old options don't work but the result versions do.
the newer result versions should also enable inline errors via phantoms, are they not showing up for you?
and lastly, for what type of builds is it not working for? on zig version 0.8.1, zig fmt and zig run output file paths differently, and the regex wasn't correctly handling that.
if possible could you open the console run sublime.log_result_regex(True) and then manually perform a build (other than a format) and then paste the output from the console?