sublime-zig-language icon indicating copy to clipboard operation
sublime-zig-language copied to clipboard

Build system missing file regex

Open gonzus opened this issue 3 years ago • 4 comments

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*(.*)$",

gonzus avatar Dec 10 '21 10:12 gonzus

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.

image

rudedogg avatar Dec 16 '21 19:12 rudedogg

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.

rudedogg avatar Dec 17 '21 04:12 rudedogg

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.

emekoi avatar Dec 18 '21 21:12 emekoi

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?

emekoi avatar Dec 18 '21 21:12 emekoi