question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source Control view ignores filesystem scheme

See original GitHub issue

Does 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:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lszomorucommented, Apr 11, 2022

@Arthurm1, thanks for the additional steps. Will try things out and will update the issue with my findings.

0reactions
Arthurm1commented, Apr 10, 2022

I don’t have an extension published but you can use the VSCode example fsprovider example from here with some additional steps…

  1. In a WSL terminal run mkdir /gittest
  2. cd /gittest
  3. git clone https://github.com/Microsoft/vscode-extension-samples
  4. cd vscode-extension-samples
  5. code fsprovider-sample
  6. In the new VSCode instance, open src/extension.ts and change the code in line 70 from vscode.Uri.parse('memfs:/') to vscode.Uri.parse('memfs:/gittest')
  7. In the VSCode terminal run npm install
  8. Press F5 to run the extension
  9. In the new VSCode instance, press F1 and run the [MemFS] Setup Workspace command

You 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 for file:///gittest/ when the only folder opened is memfs:/gittest

Read more comments on GitHub >

github_iconTop Results From Across the Web

DVCFileSystem | Data Version Control · DVC
Open-source version control system for Data Science and Machine Learning projects. Git-like experience to organize your data, models, and experiments.
Read more >
Alpha Anywhere | Configure Source Control
Some files and directories in an Alpha Anywhere workspace can be excluded from source control.
Read more >
Use Source Control Explorer to manage files - Azure Repos
Why do I see this error message: "Team Foundation Server is not your current Source Control plug-in. Click here to set the current...
Read more >
Remove a file from Git, but don't delete for remote users ...
The untracked files aren't in Git's view at all, and aren't in the ... any version control system that uses this kind of...
Read more >
Development Best Practices (with Version Control) - WP Engine
A general principle in modern software development is that version control (and Git in particular) is the right way to manage the filesystem....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found