-
Notifications
You must be signed in to change notification settings - Fork 30.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
Adding link detector regex to support c# extension #30882
Adding link detector regex to support c# extension #30882
Conversation
at app1.Program.Foo() in c:\temp\dotnet\app1\Program.cs:line 9
@rajkumar42, thanks for your PR! By analyzing the history of the files in this pull request, we identified @michelkaporin and @bpasero to be potential reviewers. |
Please review @gregg-miskelly @isidorn |
Since our matching at the end of the string isn't very strong, I think we might want to tighten up the start of path matching to only support Drive-colon ( |
Using |
Two other thoughts:
|
Agree with @gregg-miskelly comments. Is it possible to also address #28508 for c# regex while you are on it? This regex suffers of the same problem. Besides that it looks good to me. |
"(?:[\\/][^<>\\/\'\"\[\]:]*)+"+ // File path | ||
")" + | ||
":line\ " + // ends with :line literal | ||
"(\d+)", // Line number |
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.
I might suggest adding a '$' also for end-of-line after \d+
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.
Assuming that the first RegEx only needs to match full paths, LGTM.
My VS Code instance freezes with the latest changes. Here is the code I am testing it with, if it helps:
|
@rajkumar42 with your latest commit it does not match C# syntax any more. Please verify your changes before commiting, and let me know once ready for a final review 👍 |
@michelkaporin I couldn't reproduce the issue, my testing is limited to mac. I've pushed a change from single line to multiline. Can you please check if that fixes the issue? |
@isidorn would you be able to do a final review of that as I am out please? I was using the code above to test this PR on Windows. |
Ping |
Sorry for the slow response, Michel finished his internship and I was on vacation, |
Thanks for your PR and sorry that I am only now looking into this. Due to the reasons above I will not accept this PR. A PR which I would be willing to accept is one that is language agnostic and has a less cryptic structure - not a complex regex which seems very hard to maintain and modify imho |
Adding link detector regex for file links of the following format
at app1.Program.Foo() in c:\temp\dotnet\app1\Program.cs:line 9