Source Control view ignores filesystem scheme
See original GitHub issueDoes this issue occur when all extensions are disabled?: No
- VS Code Version: 1.66
- OS Version: Windows 10 + WSL 2
I’ve created a VSCode extension that uses the VSCode FileSystemAPI.
It’s registers my filesystem using something like…
const fsURI= Uri.parse("myFS:/root");
workspace.updateWorkspaceFolders(1, 0, {
uri: fsURI,
name: "My FS",
});
workspace.registerFileSystemProvider(fsURI.scheme, myProvider, {
isCaseSensitive: true,
isReadonly: true,
})
The implementation of the provider is irrelevant here (I think) and the myFS
filesystem itself works as I want it to.
Note that I’ve used /root
as the root directory of myFS
. Coincidentally, because I’m using WSL, I have all the repos that I’ve downloaded over the years as subdirs in my root dir e.g. /root/vscode
.
Once the extension has started and My FS
appears as a second folder under the VSCode file explorer, the Source Control
view adds all the git repos I’ve downloaded over the years into its view. So /root/vscode
repo is added when I’m not working on that repo. I believe this is a bug. I’d expect this if I had added file:///root
as a workspace folder but I haven’t, I’ve added myFS:/root
I can only think that the Source Control view ignores the URI scheme of the workspace folders and treats myFS:/root
as file:///root
.
Am I doing something wrong here e.g. registering myFS
incorrectly? Even so - why is the Source Control view deciding that the /root
in my filesystem is the /root
in the WSL filesystem?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
@Arthurm1, thanks for the additional steps. Will try things out and will update the issue with my findings.
I don’t have an extension published but you can use the VSCode example
fsprovider
example from here with some additional steps…mkdir /gittest
cd /gittest
git clone https://github.com/Microsoft/vscode-extension-samples
cd vscode-extension-samples
code fsprovider-sample
src/extension.ts
and change the code in line 70 fromvscode.Uri.parse('memfs:/')
tovscode.Uri.parse('memfs:/gittest')
npm install
F5
to run the extensionF1
and run the[MemFS] Setup Workspace
commandYou should now see the
MemFS - Sample
folder. Its root is simply/gittest
Check the git view and you’ll see the changes you made to
src/extension.ts
and yet you don’t have that folder on your filesystem open! Note that VSCode is showing the git changes forfile:///gittest/
when the only folder opened ismemfs:/gittest