-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[vscode] Support all workspace.fs APIs for registered fs providers #7824
Conversation
@amiramw I'm rewritting this part now to integrate with Theia FS properly. How urgent is this PR for you? We target to have vscode fs API support as in VS code in 2-3 weeks. Proposed solution only supports fs providers, not all fs APIs, since disk fs should be integrated properly, plus there are contracts between providers, e.g. when move happens other providers should be notified as well and so on. |
Specifically it is urgent for us to support delete and readDirectory for fs providers only. I don't mind contributing also the fs support (assuming it is not huge effort) but this PR scope is more urgent. |
This code will be replaced by code from VS Code extension host, not our own. We don't want to deviate.
That's very involving and we want to do it ourself to avoid long PR reviews. We have the same issue with this PR: #7718 (comment) If such PRs are minimal, i.e. changes don't affect APIs besides the plugin-ext then someone can review and test, otherwise I don't think we need to accept them. That's an effort and these code will be replaced in 2 weeks. Also such PRs are distraction from brining the complete solution. Please file issues if you want to work on something. I understand that you spent time implementing it, but I had assigned myself for #7269 and #7127 on purpose. |
Will these 2 weeks be within the scope of 1.2.0? |
I don't think so. |
That would be great 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I verified using the in-memory filesystem extension which you provided and I see the logs in the output when testing each command. I do see errors however when executing the extension (I'm not sure if it is expected):
Uncaught (in promise) Error: fsp:/a.ts
at new FileSystemError (/Users/vincentfugnit…/types-impl.js:1280)
at InPluginFileSystemProxy.handleError (/Users/vincentfugnit…system-proxy.js:226)
at InPluginFileSystemProxy.<anonymous> (/Users/vincentfugnit…system-proxy.js:214)
at step (/Users/vincentfugnit…esystem-proxy.js:59)
at Object.throw (/Users/vincentfugnit…esystem-proxy.js:40)
at rejected (/Users/vincentfugnit…esystem-proxy.js:32)
at process._tickCallback (/Users/vincentfugnit…ess/next_tick.js:68)
bundle.js:128248 Uncaught (in promise) Error: 'No available file system provider for schema file
at new FileSystemError (/Users/vincentfugnit…/types-impl.js:1280)
at InPluginFileSystemProxy.handleError (/Users/vincentfugnit…system-proxy.js:226)
at InPluginFileSystemProxy.<anonymous> (/Users/vincentfugnit…system-proxy.js:214)
at step (/Users/vincentfugnit…esystem-proxy.js:59)
at Object.throw (/Users/vincentfugnit…esystem-proxy.js:40)
at rejected (/Users/vincentfugnit…esystem-proxy.js:32)
at process._tickCallback (/Users/vincentfugnit…ess/next_tick.js:68)
bundle.js:128248 Uncaught (in promise) Error: fsp:/copyFile.txt
at new FileSystemError (/Users/vincentfugnit…/types-impl.js:1280)
at InPluginFileSystemProxy.handleError (/Users/vincentfugnit…system-proxy.js:226)
at InPluginFileSystemProxy.<anonymous> (/Users/vincentfugnit…system-proxy.js:214)
at step (/Users/vincentfugnit…esystem-proxy.js:59)
at Object.throw (/Users/vincentfugnit…esystem-proxy.js:40)
at rejected (/Users/vincentfugnit…esystem-proxy.js:32)
at process._tickCallback (/Users/vincentfugnit…ess/next_tick.js:68)
2
bundle.js:128248 Uncaught (in promise) Error: fsp:/file.txt
at new FileSystemError (/Users/vincentfugnit…/types-impl.js:1280)
at InPluginFileSystemProxy.handleError (/Users/vincentfugnit…system-proxy.js:226)
at InPluginFileSystemProxy.<anonymous> (/Users/vincentfugnit…system-proxy.js:214)
at step (/Users/vincentfugnit…esystem-proxy.js:59)
at Object.throw (/Users/vincentfugnit…esystem-proxy.js:40)
at rejected (/Users/vincentfugnit…esystem-proxy.js:32)
at process._tickCallback (/Users/vincentfugnit…ess/next_tick.js:68)
bundle.js:128248 Uncaught (in promise) Error: fsp:/file.txt
at new FileSystemError (/Users/vincentfugnit…/types-impl.js:1280)
at InPluginFileSystemProxy.handleError (/Users/vincentfugnit…system-proxy.js:226)
at InPluginFileSystemProxy.<anonymous> (/Users/vincentfugnit…system-proxy.js:197)
at step (/Users/vincentfugnit…esystem-proxy.js:59)
at Object.throw (/Users/vincentfugnit…esystem-proxy.js:40)
at rejected (/Users/vincentfugnit…esystem-proxy.js:32)
at process._tickCallback (/Users/vincentfugnit…ess/next_tick.js:68)
I don't see any errors when I tests these changes (both locally and on gitpod). Does it reproduce? |
@kittaakos @vince-fugnitto any more comments on this PR? |
@amiramw it is reproducible when running the |
@vince-fugnitto When deleted file does not exist I get: Do you suggest to handle errors differently? Because I tried to align with the way errors were thrown before in this class, like here: https://github.com/eclipse-theia/theia/pull/7824/files#diff-c908a225bec2806e57d9d1fe1c0ee3c8L70 |
Yes, I noticed the errors when first executing a
I tried your extension in vscode and the handling was better so I thought it was part of the pull-request as well: |
@vince-fugnitto the exception is thrown eventually from the vs code command handler but in theia side such exceptions are ignored. I don't think that it should be in the scope of this PR. I wouldn't mind creating another PR and add catch of an exception on:
and print error message. |
@amiramw no problem, I just wanted to bring up what I noticed during testing. |
@vince-fugnitto any more comments or can this PR be merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amiramw the changes look good to me , I’ll wait to merge tomorrow unless there are any objections :)
…ders For this phase only support registered file system providers (and not real file system) Signed-off-by: Amiram Wingarten <[email protected]>
@vince-fugnitto can i merge? |
Yes go ahead! I wasn't sure if you have the rights but if you do please go ahead :) |
@amiramw Please could you wait till the current build on master is published and then merge? |
@akosyakov is it ok now? |
Yes, the last commit has finished, CI has completed and it has been deployed 👍 |
Thank you! |
For this phase only support registered file system providers (and not real file system yet)
Signed-off-by: Amiram Wingarten [email protected]
What it does
Support all missing workspace.fs APIs for registered fs providers: stat, readDirectory, createDirectory, delete, rename and copy.
readFile and writeFile were supported already before this PR.
For the scope of this PR the new supported APIs only work with vscode extensions registered file system providers and not yet support real file system.
How to test
yarn
yarn compile
vsce package
Prior to this PR only readFile and writeFile worked. After this PR all of them should work.
Review checklist
Reminder for reviewers