0

I want to design a program that can output a clickable path to terminal, but I can't find a way to represent a clickable path with a range.

Is there anyone who knows the answer?

Version: 1.87.2 (Universal) Commit: 863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:21:31.043Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.3.0 
  • When I write ./file:1:2-3:4, the range is recognized as a position ln 4.
  • When I write ./file:1:2:3:4, it's recognized as a position ln 3 col 4.
  • When I write ./file:1-3:2-4, I'll get a no matching results after I click it.
4
  • if it is run by a task you can add a problem matcher and define what is the file, line and character Commented Mar 30, 2024 at 5:30
  • try github.com/microsoft/vscode/issues/149523 Commented Mar 30, 2024 at 5:32
  • what do you want to happen with that range, set a selection, what if you want to have a multi selection Commented Mar 30, 2024 at 5:58
  • Oddly, the shortest syntax appears to be ./file:1:2-3.4 . From starball's list and tested in the terminal. Commented Apr 1, 2024 at 18:02

1 Answer 1

1

There's a list of supported formats in terminalLinkParsing at the definition of lineAndColumnRegexClauses.

At the time of this writing, among the supported formats, I see

  • foo:339:12-789
  • foo:339:12-341.789
  • "foo",339.12-789
  • "foo",339.12-341.789
  • "foo", lines 339-341
  • "foo", lines 339-341, characters 12-789

See also How does VS Code recognize URLs in text (strings)?.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.