Fix for #200257 plus existing trailing non-numerics regex fix#200919
Fix for #200257 plus existing trailing non-numerics regex fix#200919Tyriar merged 10 commits intomicrosoft:mainfrom sparxooo:200257-fix
Conversation
|
@microsoft-github-policy-service agree |
src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkOpeners.ts
Outdated
Show resolved
Hide resolved
|
Latest commit I have updated the regex at terminalLinkOpeners.ts:111 in-line with Tyriar's suggestion. I have updated the TerminalSearchLinkOpener test suite with extra tests for the altered Grep/Ruby regex, plus the trailing period regex. These tests include both line number only, and line / column number tests. I also added line number only tests to the "workspace with spaces" test for completeness. |
|
Thanks Tyriar Regarding the trailing period issue, although this will catch this: It won't catch this: If I changed the trailing period regex line to Then it would gracefully handle |
…eriod tests for trailing periods without line numbers
|
It's hard to say what the right behavior is here as these links are meant to be very simple and driven by the |
Fix for microsoft#200257 plus existing trailing non-numerics regex fix
This is a draft PR for a fix for issue #200257
Whilst figuring how to fix the issue I created, it appeared that the regex at terminalLinkOpeners.ts:111 was incorrect. Here are the old and new regex side by side, with what I expect the original coder intended. I also tested grep output with filenames/line numbers, and that seems to be correct also.
The trailing period issue has also been fixed with a new text.replace step with (hopefully) a correct regex, that currently only removes trailing periods from line/column numbers (for instance, "test.ts." should be left alone).
The big question possibly is, is there any reason why a trailing period on a link should remain? If not, I guess you could just remove any trailing period regardless of it's preceding text.