-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add api for virtual file system provider #124903
Conversation
There are scenarios in which a file system provider cannot map a URI to a local path. In order to satisfy those cases, we should enable file system providers to specify whether the file system is trusted or not. I believe that this would resolve the LiveShare scenario (#120251 (comment)) to that they can transfer trust from the host to the guest. |
Needing to duplicate an API in two places tells me that both places are wrong. Why isn’t there one central place where extensions can register such canonical uri logic? Assuming, there is I believe that you don't want to get in the business of canonical uris because it will quickly turn into a bottom-less hole. Isn't your the problem more like "How do I know that the |
This is itself interesting because one of the challenges we will face with virtual file systems is that they are registered "too late". At the present, we are able to calculate workspace trust before the extension host is brought online. With virtual file systems, we would not be able to do that unless we bring those up like resolvers.
It would be great to get @eamodio 's thoughts on this since he has multiple use-cases of vfs and can share his expectations
I'm happy to explore this. Do have thoughts on what that would look like? I assume you would expect it to be general as mentioned in the first point. It's not necessarily just workspace aliases thought. Arbitrary uris need to be transformed as well. |
I question if what we want here is really a "canonical" uri. IMO, it is more specifically a "trust" uri. While they are could be similar, we want a specific behavior here. Given a virtual uri, we want to be given the "root" uri that we should trust. But if we call it |
@lszomoru fyi we moved this out to August |
closing in favor of new canonical uri provider |
This PR adds the same
getCanonicalUri
method from resolvers to file system providers. This is necessary to allow remapping arbitrary uris to those of the workspace when relevant.e.g. gitlens allows opening the workspace at a given commit. we should trust this operation because the files are those in the workspace but the workspace uri scheme is not matching.