-
Notifications
You must be signed in to change notification settings - Fork 30k
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
explorer: support for dnd remote resources #98817
Conversation
Tricky, the file service might already have a provider registered for the Interestingly @mjbvz brought up a related question in b84597e where he needs to access the contents of a remote file from the I was initially worried that putting the contents of the entire file into the transfer might be problematic, but now that I have learned about |
@bpasero thanks for the quick response. |
@bpasero did some googling and the only thing found is what you are already using for web dnd here. What I do not fully understand is why don't we take the same approach as we do for the web in the remote case? When we start dragging can't we fill in the same data as being done nativly when DnD from desktop starts? Or that is somehow magically done and we can not replicate it in the remote case? |
Yeah that is what I was suggesting, finding out if we can actually do the same thing that happens when you drag a file from the desktop. If we could add a |
After some googling I have pushed a new approach for this, that we programitically add the File object to the data transfer as suggested here Testing it out now... |
@isidorn upon more thinking I had another idea: every remote exposes its resources through a simple HTTP server. We use this for example to be able to load images in markdown preview when shown on remote or for example to load themes when installed inside the remote. If for each
Which every VSCode window can resolve (we register a protocol handler for Maybe you should simply introduce a new I would think there is 2 places where we can leverage this:
|
@bpasero cool idea and thanks for the writeup. |
One thing I realised now is that we do not seem to have any file system provider registered for the vscode/src/vs/code/electron-main/app.ts Line 828 in 8cd23cf
So we probably need to do something like that, or use |
Ok I looked into it a bit more and I think I am stuck. Even though we handle
@deepak1556 @mjbvz or @alexdima maybe you could advise. The question is this:
|
@bpasero for fetch api to work with custom protocol, |
I think I got something to work, thanks for the help. Summary:
This should allow to DND files over from the explorer to copy it into a local explorer. There is another case where we could use it: when dragging editors around. Currently you cannot drop an editor to a local instance because the URI is |
We did not have time to look more into this. Moving to next milestone so I try to make something out of Ben's findings. |
Closing as no plan to merge. |
Fixes #93599
This PR is Work in Progress and it:
CodeRemoteFiles
What is missing: as @bpasero pointed out "local window needs to use some service (we probably have to add it) to resolve the content. This service could broadcast to windows (via electron-main) and ask the remote window to provide the contents".
Currently the explorer simply uses the
workingCopyService
which forwards everything to thefileService
and the explorer simply passes the correct remote URIs.So where would be the best place to live for this service that communicates to the other window?
Could this be done as part of the
fileService
?Alternative is for the explorer to treat remote resources differently and use a
remoteWorkingCopyService
to copy remote resources.@bpasero let me know what you think
fyi @steven166