-
Notifications
You must be signed in to change notification settings - Fork 29.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #200257 plus existing trailing non-numerics regex fix #200919
Conversation
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the tests 👏
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
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.