Support . as a row:column separator in terminal link detector#190351
Support . as a row:column separator in terminal link detector#190351Tyriar merged 2 commits intomicrosoft:mainfrom
Conversation
The motivation here is the Sail language compiler which outputs errors conforming to the GNU style https://www.gnu.org/prep/standards/html_node/Errors.html I think they must be the only people in the world actually using the `line0.col0-line1.col1` format. I did have an attempt to capture the ending line/column but it is very difficult with regex, and not that useful anyway so I've opted for the simpler option of just ignoring the `-` part.
Tyriar
left a comment
There was a problem hiding this comment.
Great PR! LGTM provided the tests pass
I think they must be the only people in the world actually using the line0.col0-line1.col1 format. I did have an attempt to capture the ending line/column but it is very difficult with regex, and not that useful anyway so I've opted for the simpler option of just ignoring the - part.
We don't do have one that interleaves like that yet, but you might be able to add a new lineAndColumnRegexClauses that does something like this:
"${r()}\.${c()}-${re}\.${ce}"|
Wow thanks for the fast review! I did think about adding that one but then I saw that it would involve adding a new regex and changing the code that reads the capture groups and I wasn't even sure VSCode actually uses the end lines/columns... Maybe that's just an excuse for my laziness :-) |
|
A new regex is fine for the class of links that contain them interleaved like that, I expect it to work fine with the new regex. Feel free to leave this PR as is and create a new one to include that (or not bother, no commitment). |
The motivation here is the Sail language compiler which outputs errors conforming to the GNU style
https://www.gnu.org/prep/standards/html_node/Errors.html
I think they must be the only people in the world actually using the
line0.col0-line1.col1format. I did have an attempt to capture the ending line/column but it is very difficult with regex, and not that useful anyway so I've opted for the simpler option of just ignoring the-part.Fixes #190350
The easiest way to test this is to make a file
test.txtcontaining something like this:Then
catit in the integrated terminal and click the links.