Skip to content

Support /dir/file_path.txt, <line> link format #217927

@rahultadak

Description

@rahultadak

Type: Feature Request

My tool spits out errors in the format:
/home/rahultadakamadla/file.svh, 204
Please note the space between the comma and the line number. It seems this type of link is not supported at the moment. Can you please add support for this?

VS Code version: Code 1.90.2 (5437499, 2024-06-18T22:34:26.404Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 4.18.0-513.9.1.el8_9.x86_64

Activity

MaliusArth

MaliusArth commented on Sep 14, 2024

@MaliusArth

file_path.ext(157:60) also is not recognized properly
it jumps to the file but doesn't position the cursor on the line & column
please support both

Tyriar

Tyriar commented on Sep 26, 2024

@Tyriar
Member

Here are the formats we currently support:

// The comments in the regex below use real strings/numbers for better readability, here's
// the legend:
// - Path = foo
// - Row = 339
// - Col = 12
// - RowEnd = 341
// - ColEnd = 789
//
// These all support single quote ' in the place of " and [] in the place of ()
//
// See the tests for an exhaustive list of all supported formats
const lineAndColumnRegexClauses = [
// foo:339
// foo:339:12
// foo:339:12-789
// foo:339:12-341.789
// foo:339.12
// foo 339
// foo 339:12 [#140780]
// foo 339.12
// foo#339
// foo#339:12 [#190288]
// foo#339.12
// "foo",339
// "foo",339:12
// "foo",339.12
// "foo",339.12-789
// "foo",339.12-341.789
`(?::|#| |['"],)${r()}([:.]${c()}(?:-(?:${re()}\\.)?${ce()})?)?` + eolSuffix,
// The quotes below are optional [#171652]
// "foo", line 339 [#40468]
// "foo", line 339, col 12
// "foo", line 339, column 12
// "foo":line 339
// "foo":line 339, col 12
// "foo":line 339, column 12
// "foo": line 339
// "foo": line 339, col 12
// "foo": line 339, column 12
// "foo" on line 339
// "foo" on line 339, col 12
// "foo" on line 339, column 12
// "foo" line 339 column 12
// "foo", line 339, character 12 [#171880]
// "foo", line 339, characters 12-789 [#171880]
// "foo", lines 339-341 [#171880]
// "foo", lines 339-341, characters 12-789 [#178287]
`['"]?(?:,? |: ?| on )lines? ${r()}(?:-${re()})?(?:,? (?:col(?:umn)?|characters?) ${c()}(?:-${ce()})?)?` + eolSuffix,
// foo(339)
// foo(339,12)
// foo(339, 12)
// foo (339)
// ...
// foo: (339)
// ...
`:? ?[\\[\\(]${r()}(?:, ?${c()})?[\\]\\)]` + eolSuffix,
];

Tyriar

Tyriar commented on Sep 26, 2024

@Tyriar
Member

@MaliusArth created #229842 for your request

changed the title [-]File navigation from integrated terminal doesn't use line number[/-] [+]Support `/dir/file_path.txt, <line>` link format[/+] on Sep 26, 2024
added
help wantedIssues identified as good community contribution opportunities
feature-requestRequest for new features or functionality
good first issueIssues identified as good for first-time contributors
on Sep 26, 2024
added this to the Backlog milestone on Sep 26, 2024
modified the milestones: Backlog, November 2024 on Nov 7, 2024
added
unreleasedPatch has not yet been released in VS Code Insiders
insiders-releasedPatch has been released in VS Code Insiders
and removed
unreleasedPatch has not yet been released in VS Code Insiders
on Nov 7, 2024
locked and limited conversation to collaborators on Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalitygood first issueIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesinsiders-releasedPatch has been released in VS Code Insidersterminal-linksverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Relationships

None yet

    Participants

    @MaliusArth@Tyriar@rahultadak@meganrogge@joyceerhl

    Issue actions

      Support `/dir/file_path.txt, <line>` link format · Issue #217927 · microsoft/vscode