-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Added Support Of /dir/file_path.txt, <line> link format #217927 #229964
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
base: main
Are you sure you want to change the base?
Conversation
// Support for '/path/to/file, 204' | ||
`['"]?${p()}, ${r()}` + eolSuffix, |
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 think we could add this to the top entry in the array, by just adding ,
as an option in this group:
Before: (?::|#| |['"],)
After: (?::|#|,| |['"],)
We will also need some tests to cover this case here:
vscode/src/vs/workbench/contrib/terminalContrib/links/test/browser/terminalLinkParsing.test.ts
Lines 42 to 62 in 13ac4f2
const testLinks: ITestLink[] = [ | |
// Simple | |
{ link: 'foo', prefix: undefined, suffix: undefined, hasRow: false, hasCol: false }, | |
{ link: 'foo:339', prefix: undefined, suffix: ':339', hasRow: true, hasCol: false }, | |
{ link: 'foo:339:12', prefix: undefined, suffix: ':339:12', hasRow: true, hasCol: true }, | |
{ link: 'foo:339:12-789', prefix: undefined, suffix: ':339:12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo:339.12', prefix: undefined, suffix: ':339.12', hasRow: true, hasCol: true }, | |
{ link: 'foo:339.12-789', prefix: undefined, suffix: ':339.12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo:339.12-341.789', prefix: undefined, suffix: ':339.12-341.789', hasRow: true, hasCol: true, hasRowEnd: true, hasColEnd: true }, | |
{ link: 'foo#339', prefix: undefined, suffix: '#339', hasRow: true, hasCol: false }, | |
{ link: 'foo#339:12', prefix: undefined, suffix: '#339:12', hasRow: true, hasCol: true }, | |
{ link: 'foo#339:12-789', prefix: undefined, suffix: '#339:12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo#339.12', prefix: undefined, suffix: '#339.12', hasRow: true, hasCol: true }, | |
{ link: 'foo#339.12-789', prefix: undefined, suffix: '#339.12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo#339.12-341.789', prefix: undefined, suffix: '#339.12-341.789', hasRow: true, hasCol: true, hasRowEnd: true, hasColEnd: true }, | |
{ link: 'foo 339', prefix: undefined, suffix: ' 339', hasRow: true, hasCol: false }, | |
{ link: 'foo 339:12', prefix: undefined, suffix: ' 339:12', hasRow: true, hasCol: true }, | |
{ link: 'foo 339:12-789', prefix: undefined, suffix: ' 339:12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo 339.12', prefix: undefined, suffix: ' 339.12', hasRow: true, hasCol: true }, | |
{ link: 'foo 339.12-789', prefix: undefined, suffix: ' 339.12-789', hasRow: true, hasCol: true, hasRowEnd: false, hasColEnd: true }, | |
{ link: 'foo 339.12-341.789', prefix: undefined, suffix: ' 339.12-341.789', hasRow: true, hasCol: true, hasRowEnd: true, hasColEnd: true }, |
@@ -117,6 +117,8 @@ function generateLinkSuffixRegex(eolOnly: boolean) { | |||
// foo: (339) | |||
// ... | |||
`:? ?[\\[\\(]${r()}(?:, ?${c()})?[\\]\\)]` + eolSuffix, | |||
// Support for '/path/to/file, 204' | |||
`['"]?${p()}, ${r()}` + eolSuffix, |
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.
Oh there's also a compile error here:
[tsec-compile-check ] src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkParsing.ts(121,11): error TS2304: Cannot find name 'p'.
Note that r() is row, c() is column
Did you use AI to generate the PR description? You say you tested it locally and added a unit test but neither can be true as it would give a runtime error? |
Yes i did use AI to generate description because i am bad at grammar so i just explained my work and it gave me a description so i edited the description a little bit so yeah AI can ruin work I am having errors in my local machine for no reasons i spent hours to build vs code but it gives error in my system and i think its because of some hardware problem and not because of the changes i made. i followed the steps for building vs code oss but i failed and i tried to fix it and it just give rise to new error But i was not surprised because i always get this type of error when i build electron apps But i will try to build vs code oss again on linux machine i guess And i will make changes to the PR that you requested. |
Yes i did use AI to generate description because i am bad at grammar so i just explained my work and it gave me a description so i edited the description a little bit so yeah AI can ruin work I am having errors in my local machine for no reasons i spent hours to build vs code but it gives error in my system and i think its because of some hardware problem and not because of the changes i made. i followed the steps for building vs code oss but i failed and i tried to fix it and it just give rise to new error But i was not surprised because i always get this type of error when i build electron apps But i will try again on linux machine i guess And i will make changes to the PR that you requested. Also can i ask for help here if i face any problems? 😭 |
@vp007-dev no problem, just it had incorrect information. You don't need perfect grammar, just Instructions to set up are here. I can try help if you give an error but I'm often busy so don't respond too often. |
I've never seen that one. I guess the first thing I'd try is look at the problem file it's talking about and seeing if it does indeed lack a |
This Pull Request adds support for file paths in the format /dir/file_path.txt, (with a space after the comma) in VS Code. Previously, this format was not recognized by the editor, causing issues when navigating to specific lines in error messages or logs that follow this format.
### Changes introduced:
Added a new regex clause to handle the /dir/file_path.txt, format with a space between the comma and line number.
Updated the lineAndColumnRegexClauses to ensure correct parsing of file paths with this format.
Added relevant tests to ensure compatibility and coverage.
### Example:
Error messages in the format /home/rahultadakamadla/file.svh, 204 are now clickable, allowing users to directly jump to the specified line in the file.
**### Checklist:
Followed VS Code's contribution guidelines**
### Related Issues:
Closes #217927