0

In VS Code output panel, writing a URL with http(s):// can be detected as a link. Of course file links (the file_name.ext:line_number:column format) can be detected in terminal. Is it possible to file link to be detected in output panel, too?

Here's an initial code put inside activate() in extension.ts:

 let out = vscode.window.createOutputChannel("sample"); out.append("./file.txt:3"); out.show(); 

Here's a screenshot for output panel with a sample workspace folder. It's not detected as a link.

initial output

1

1 Answer 1

0

From the comment and upon further searching, I found so far that only the absolute path of file in a workspace will be detected as file link in output panel.

Here's my code:

 out.appendLine("file.txt:2"); out.appendLine("test0\\file.txt:2"); out.appendLine("\\file.txt:2"); out.appendLine("\\test0\\file.txt:2"); out.appendLine(".\\file.txt:2"); out.appendLine(".\\test0\\file.txt:2"); out.appendLine("C:\\Users\\gina\\Desktop\\test0\\file.txt:2"); out.appendLine("C:\\Users\\gina\\Desktop\\file2.txt:3"); // not in workspace 

And here's the output: output panel output Only the second to the last was detected as a link.

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.