-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Unsafe canHandleResource usages #48275
Comments
e.g. the |
@jrieken yeah unhappy, I was assuming this would be a way to statically find out if a resource is supported in the file service or not, but I see how this is not true when remote file system providers come and go. Also adding @isidorn for some places where we use this e.g. in the resource context key to adjust enablement for commands. I need to revisit the file editor input serialisation and creation given this, but would like to keep using the |
We were focused on grid this milestone, next week I am on vacation, this is not for endgame -> June |
I have pushed a change that ensures a @isidorn I leave that one up to you to see what needs to be done |
I decided to remove resource.isFile context key completely. Reasons:
I will mention in the release notes that this context key is not removed ( I do not believe people are using it that often) |
Went all over github and only two repos use "resourceIsFile" I will give them an issue. |
I still see (early) access to There are also other usages but I they don't look critical... To reproduce, have a workspace with a remote fs entry (e.g MemFS), open a few files from that workspace, set a breakpoint here, and reload. |
@isidorn re |
@jrieken thanks, I have pushed a commit which improves this. |
We have
RemoteFileService#canHandleResource
which was introduced as workaround to be able to restore editors from providers that aren't known (yet) but that were around during the last session: https://github.com//Microsoft/vscode/commit/a23633b5d42dc486a668e49a232957696750c254.This wasn't designed to be a general purpose API and I am surprised by its popularity. In hindsight the
FileEditorInput
should have serialised that knowledge about other-schemes and not the file service. I want to make that change but many other references leave me puzzled. This is what's to docanHandleResource
in combination withonDidChangeFileSystemProviderRegistrations
file
-schemeThe text was updated successfully, but these errors were encountered: