File access from web extensions is broken #44904
Replies: 5 comments
-
Any comments on this issue? |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
Thanks, extension developers have the ability to do that when they have control over the paths (e.g. by injecting a filereader for a debugger as done here: https://github.com/microsoft/vscode-mock-debug/blob/main/src/activateMockDebug.ts#L187).
This is also raised on VS Code here: microsoft/vscode#171991 I was also under the impression this discussion IS GitHub support!
This isn't possible, paths in the debug adapter protocol are strings and get passed straight to the VS Code UI
I've successfully done this with the paths for reading files: But can't see how to modify paths coming back from the debugger :/
To that end, I've created instructions and a demo example extension to recreate the issue here: https://github.com/thegecko/vscode-web-test I'm very keen to get an update on this or at least to confirm if the issue is with the adapter (there may be a certain path format to use), VS Code or codespaces. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
I can confirm this is a string formatting issue. A fix for |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
I believe a change has been made in the file scheme used in Codespaces and the github.dev versions of VS Code for web which has broken the ability for Local/Web extensions (those installed in the web extension host) to effectively use file paths or use the workspace.fs.* APIs.
For example, a debug adapter running in the web extension uses paths which are no longer recognised by the UI.
To recreate this, install the mock-debug extension in the web extension host of the VSCode for web flavours and observe the differences:
vscode.dev
The debugger runs in the browser and accesses files using the browser filesystem API. All works as expected.
@vscode/test-web
This runs on a developer's machine and I believe should mimic how codespaces/github.dev work. This works as expected.
github.dev
The debugger fails when setting breakpoints or opening files with:
codespaces
You must ensure
mock-debug
is installed "Locally" in the web extension host, (by default it is installed in the codespace host and will work correctly) by modifying the settings:In the web extension host, similar errors are seen as
github.dev
:Unfortunately codespaces and github.dev are also the only environments you cannot sideload or debug extensions in, so debugging this issue is extremely challenging.
I've tried reformatting paths prepending
vscode-remote://
and variations on the root fspath but this doesn't work.How should a debug adapter format paths so they can be opened by the UI in codespaces/github.dev when the scheme and authority aren't present?
Beta Was this translation helpful? Give feedback.
All reactions