Skip to content

Test: Terminal link improvements #172084

@Tyriar

Description

@Tyriar

Refs: #158810, #161543, #148062, #97941

Complexity: 4

Create Issue


The terminal got a lot of improvements to links this iteration, test all the following link types:

  • vscode:// links - An example link to use is echo "vscode-insiders://file/C:/Users/Daniel/Downloads/image.png" using a valid path on your system
  • Links containing [ and ] - See Full support for local files and folders containing [ and ] chars #169774 for a list of format examples that should work
  • /mnt/, \\wsl.localhost\ and \\wsl$\ links - Examples:
    • /mnt/c/Users/Daniel/Documents/somefile.txt
    • \\wsl.localhost\Debian\home\daniel\somefile.txt
    • \\wsl$\Debian\home\daniel\somefile.txt
  • Links containing spaces. The following formats should work:
    • When the entire line is a valid file (and a portion of it was not yet matched to another valid file link): <path>
    • Python style links: From "<path>", line <line>
    • C++ compiler(?) style errors: <path>(<line>,<col>) :<...>
    • Independently styled file paths: foo<underlined_path>bar

All formats should work for both files and folders, and all except for vscode:// should work with the various line/col matching patterns detailed here:

// The comments in the regex below use real strings/numbers for better readability, here's
// the legend:
// - Path = foo
// - Row = 339
// - Col = 12
//
// These all support single quote ' in the place of " and [] in the place of ()
const lineAndColumnRegexClauses = [
// foo:339
// foo:339:12
// foo 339
// foo 339:12 [#140780]
// "foo",339
// "foo",339:12
`(?::| |['"],)${l()}(:${c()})?$`,
// 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
`['"]?(?:, |: ?| on )line ${l()}(, col(?:umn)? ${c()})?$`,
// foo(339)
// foo(339,12)
// foo(339, 12)
// foo (339)
// foo (339,12)
// foo (339, 12)
` ?[\\[\\(]${l()}(?:, ?${c()})?[\\]\\)]$`,
];

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions