Open nh2 opened 7 years ago
So this partially works for me. I can step through the errors using F4 in the results pane, but the errors don't show up overlayed on the actual file. Nor can I click on the filename in the results pane to navigate to the file:line:col.
I can confirm that the build system regex does not match multiple lines, using the following build definition.
{
"selector": "source.haskell",
"cmd": ["ghc", "-dynamic", "-fno-code", "$file"],
"working_dir": "$file_path",
"file_regex": "^(.*):(\\d+):(\\d+):.*\\n\\s*(.*)$"
}
Invoking the build fails to display errors, but when file_regex
is changed to "^(.*):(\\d+):(\\d+):.*$"
(removing the newline), invoking the build causes errors display as expected (albeit without the error message).
Here is the output I am trying to match:
sample-file.hs:12:26: error:
Not in scope: type constructor or class ‘Messages’
Perhaps you meant ‘Message’ (line 7)
|
12 | makeMessage :: String -> Messages
| ^^^^^^^^
My regex ^(.*):(\d+):(\d+):.*\n\s*(.*)$
works, according to https://regex101.com/
It would be nice to see this fixed in the next release...
+1
I've been trying to do exactly what this issue states but for Python error messages (here's a line_regex
example that works, but not if added to file_regex
) & it seems like line_regex
does support multi-line capturing but its captures are not shown anywhere (possibly if not captured by file_regex
first).
Some build systems output multiline errors, for example the GHC Haskell compiler:
Here, the error message is on the second line.
This cannot currently be parsed by Sublime's
file_regex
functionality in build systems, because apparently that regex does not support multiline.It would be great if we could allow a multi-line
file_regex
to support errors like the above.(see also https://forum.sublimetext.com/t/matching-multiline-build-system-output-file-regex/23414)