Inconsistency in workspace folder URIs #2751
Unanswered
kamrann
asked this question in
Extension Development QnA
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This is my first experience trying to write an extension (LSP client) for VS Code. My Javascript experience is minimal.
Here's what I'm seeing (VS Code desktop on Windows):
C:/somewhere/x
LSP
Initialize
sendsworkspaceFolders
: [file:///workspace
]C:/somewhere/y
LSP
workspaceFoldersChanged
adds [file:///c%3A/somewhere/y
]Why the different format?
C:/somewhere/z
LSP
workspaceFoldersChanged
adds [file:///c%3A/somewhere/z
]C:/somewhere/x
LSP server restarted
Initialize
sendsworkspaceFolders
: [file:///workspace/y
,file:///workspace/z
]So now the exact same folders have suddenly become virtual?
From this point, further 'Add folder to workspace' invocations can yield either a
file:///workspace/...
or afile:///c%3A//...
, which one I get is seemingly arbitrary.On vscode.dev, the behaviour is different yet again. Opening a local folder yields URIs of the form
file:///x
. Unless I open a remote Github folder, in which case it's back tofile:///workspace
.If these URIs were just opaque identifiers then it would merely be bizarre without being a major problem. But since an LSP server needs to be able to map between URIs and filepaths, this behaviour seems to make it impossible to create an extension that behaves reliably. Am I missing something?
Beta Was this translation helpful? Give feedback.
All reactions