Reputation: 198318
If I don't understand wrong, sublime can capture file and line number from error output, by configure the file_regex
or line_regex
.
I have such error output:
main.<anonymous closure>.<anonymous closure> file:///Users/freewind/dev/workspace/RythmDart/test/test_grammar.dart 135:19
How to configure the build file?
I tried:
"line_regex": "([\\w/:\\-_]*) (\\d*):(\\d*)",
But it doesn't work.
Upvotes: 2
Views: 2661
Reputation: 2702
This works for me:
"file_regex": ".*file:\/\/\/(.*):([0-9]*):[0-9]*",
Note that:
I am running a simple dart command line program and get output like this:
Hello world
Unhandled exception:
exception
#0 main (file:///C:/src_test/dart/dart_test.dart:4:3)
Here is my test program:
void main() {
print("Hello world\n");
throw 'exception';
}
edit:
for mac, it should be:
"file_regex": ".*file:\/\/(.*):([0-9]*):[0-9]*",
Notice there are only two \/
s after file:
, or sublime will try to find a file with wrong path, e.g.
~/dev/dart/myproject/Users/home/freewind/dev/dart/myproject/test.dart
If I use two \/
, it will be correct:
/Users/home/freewind/dev/dart/myproject/test.dart
Upvotes: 2