Move to a broader regex#28
Conversation
Also generate the messages in the linter to fix several issues such as the file path being incorrect on Windows. Since ruby only gives a line number for errors provide a range that covers the entire line.
|
For reference here is a test of the regex on every message variation that I could find as a possible output in the Ruby source: https://regex101.com/r/zC2nG8/4 |
lib/main.js
Outdated
There was a problem hiding this comment.
instead of going one level deep, how about you use a return
Removes the unnecessary `msg` variable. Also returns early if no matches were found instead of wrapping the entire inner part in the if block.
|
Anything you can spot wrong with this @k2b6s9j? Anything else @steelbrain? |
|
Ruby is not my thing, I'll leave this to @k2b6s9j |
|
While I would prefer to have the error selected in cases where it is shown ( for example, in the case of syntax errors ) this does fix the issue very well. Thank you @Arcanemagus. |
|
Thank for demonstrating the regex using regex101 by the way. |
|
This will be publish in the next patch release. |
|
How does this look? https://regex101.com/r/zC2nG8/5 (I'm assuming that you meant you wanted the "syntax error, " part cut out of the messages where it is irrelevant.) |
|
It looks nice. Thanks for that! |
|
Btw version 2 of that also includes a capturing group for the traces, but would need the output processed as a whole instead of line-by-line. If you were interested 😉. |
|
Oh boy. That sounds great. I'm busy right now with prepping for the upcoming school year. So I'm really only maintaining things right now, not writing new things. If you have the time and are interested you could implement it in a pull request and I'll merge it in. |
|
This has been published in version 1.0.2. |
Also generate the messages in the linter to fix several issues such as the file path being incorrect on Windows. Since ruby only gives a line number for errors provide a range that covers the entire line.
Should fix steelbrain/linter#822 and make the errors show on the file instead of the "project" on Windows.