简体   繁体   中英

Opening files through URL handling doesn't open file in files own workspace

I am trying to open VS Code from my web app through URL handling. I found the PR URL handling has been implemented and merged on GitHub . What I am trying to do is to open a file in its workspace. I found that with the current implementation it is not possible to do that since only the file and the lines parsed from the URL with this format vscode://file/%%f:%%l .

In the PR it's been said that the opening behavior is the same as running code -g -r /path/to/file on local machine. But running this script opens the file in its workspace if the workspace is already opened on VS Code. Doesn't matter if it is focused or not, if that workspace somehow opened, VS Code opens the file in its original workspace.

I believe VS Code folks are doing great job. Am I missing something here or local script and URL handling just behaves differently than I experienced.

BTW I tried almost all versions of VS Code after September 2017.

VSCode 1.43 (Q1 2020) might improve those protocol links by adding the possibility to open folders and workspace.

For a while, VSCode supported to open files through protocol links (eg vscode://file/<file-path> ).
In this milestone, we expanded the support to include opening folders or workspaces .

The syntax is the same:

 vscode://file/<path> vscode-insiders://file/<path>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM