如何使用 vscode:// 链接打开文件

cob*_*ash 4 visual-studio-code

我想像phpstorm一样使用vscode ide链接。

我知道我们可以phpstorm://open?file=@filepath&line=@line

如何使用vscode达到同样的效果?

多谢。

cob*_*ash 7

这个链接:

vscode://file/@file:@line
Run Code Online (Sandbox Code Playgroud)

作品。


示例:如果您想打开第 10 行,/path/to/file.txt则链接将为:

vscode://file/path/to/file.txt:10
Run Code Online (Sandbox Code Playgroud)