-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Finalise FileSystemProvider api #47475
Comments
@jrieken How about a way to get the current SearchProvider, or the default one if none is registered? The scenario is that an extension wants to run find-in-files and get the results off the current workspace, including unsaved changes in the editor buffers. |
@IlyaBiryukov the |
Great to see this progress!
|
@jrieken I want to provide multiple file systems on the same scheme. But I'm not sure if this should be a feature request or if I should just implement the multiplexing myself...
Either way, vscode should (but does not currently) throw an error if registering a conflicting file system provider. The current behavior is to simply ignore subsequent registrations. |
That is the plan but raw read/write isn't part of the proposed API yet. The internal variant is ready and can be found here: https://github.com/Microsoft/vscode/blob/f373a15de059b7ed4918797172eeea224a7a939c/src/vs/platform/files/common/files.ts#L206
Yeah, it will make our implementation simpler ;-). Internally, we just have delete and knowing what to delete would require another stat-call. This API is more loose but allows for more freedom, e.g for something like
Just name-polish and depending on the scheme vs scheme+authority discussion more fine grained control.
We only have to allow for more rapid change without carnage. Plan is to remove it end of this week.
Yeah, tough question. Agreeing on throwing on double registration - that is something we miss today. On the one side knowing how to handle a certain scheme should be enough, e.g. all |
@jrieken small bug: vscode.d.ts declares |
Thanks, fixed that |
@jrieken what does it mean for |
The I see how |
So |
@jrieken when will (I'm using fb-watchman, which always does a recursive watch, unless I specify an expression to filter out results from subdirs). |
Yeah, we might call it for files, not just folders. Today, the driver does two things: Call watch recursive and with user-defined-excludes (like /node_modules/) for every (workspace-)folder and watch all files that are open and not inside those folders. |
Sure, but |
Yep, it should be set to
|
@jrieken |
Fair point. Today the option is more or less ignored, see #48258. I tend to keep the option simple and eventually support multiplexing in VS Code, e.g. accepting an object instead of a scheme for fs-providers (similar to document selectors), e.g. |
@jrieken maybe add |
@jrieken It's not clear how symlinks should be handled. Do you support both symlinks to files and directories, or just files? (I.e. are |
Yeah, the symbol is additive to the type-flag. So, be either a file, folder, xor unknown and a symlink.
Yeah, I like |
@jrieken Given a chain of symlinks, A -> B -> ... -> foo.txt, should the stats (is-file, is-directory, mtime, etc.) be from A, B, or foo.txt? |
I believe that in POSIX these flags are mutually exclusive in The VS Code does not have to map 1:1 with these syscalls, but it should be explicit about what it expects. |
It should be the stat of foo.txt plus the information about it being a symlink. Yep, this isn't posix but tailored to our use-case. I have added doc-comment about that |
For April we want to finalise the FileSystemProvider API. This will be mostly simplifying things and fixing how we read/write data. This issue is a bit of a kitchen sink
readFile
andwriteFile
since that's easy to implement and since it covers most use-casesFileSystemProvider#move
toFileSystemProvider#rename
FileSystemProvider#copy
[name, stat]
tuples, not[uri, stat]
tuplesonFileSystem
, e.g.onFileSystem:foo
should file scheme providers (schemes) be registered in package.json?watch(resource: Uri, opts:{ recursive:boolean}): Disposable
functionAPI Evolution
In order prevent breakage of early adopters we work on a copy of the current proposed API. To prevent a lock-step-approach we will "version" the new API. See below
FileSystemProvider2
the_version
-type will change, e.g. from1
to2
etc.registerFileSystemProvider
-function will check that the newprovider
implements the proper version of the latest, proposed API, e.g._version: 2
and only then register that provider. Otherwise it will use the old,fallback
, provider./cc @siegebell @bolinfest @hansonw
Sample
A sample, memory-based file system provider can be found here: https://github.com/Microsoft/vscode-extension-samples/blob/master/fsprovider-sample/
The text was updated successfully, but these errors were encountered: