-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Experiment: remote file system #30337
Conversation
This is built on top of microsoft/vscode#30337. Note that I had to follow the instructions at microsoft/vscode#13394 to be able to run this extension from the OSS version of VS Code. Unfortunately, that means I made a personal modification to `.vscode/launch.json`, so hopefully I can find some way to avoid that. This is pretty exciting in that I had to make minimal changes to my existing extension to get this to work! The only issue that I'm running into right now is that `resolveContents()` appears to be called more often than I expect. It is called twice when I open the file for the first time. I also opened a remote `.md` file using this mechanism. I was able to use `Markdown: Open Preview` on this remote file, but when I closed the preview, `resolveContents()` was called again and I'm not sure why. Because loading remote file contents could be expensive, we would ideally fix things so this is called sparingly, or we'll have to maintain a local cache to avoid extra roundtrips. Note that I had to launch the OSS version (built from source) using `./scripts/code.sh --remote nuclide`. There is a TODO in the PR to eliminate the need to pass this flag.
Good news! I got this working with my existing demo with very few code changes: bolinfest/vs-code-preview-html@4e7647b As you can see from the commit message for that commit, I'm seeing I'm also excited to see that both methods can return a I also haven't tried wiring up any remote LSPs yet. I may not be able to do that until Wednesday. |
FYI - I have removed the need for the
Can you provide a little more detail? Today, we throw things away when the last editor or tab closes, when then opening a file again we go back the truth. Is that what you are seeing or are there other unexpected calls?
Yeah, error handling should be working (tho is untested 🙈). Also, as suggested we should look into some sort of streaming API that enables providers to deliver a file in chunks. That and a long list of other features is to be defined, let's for now focus on the MVP |
@jrieken Are you sure things are still working now that you dropped the |
@jrieken Yep, I went back to what you had before (the top of the stack of two commits) and rebuilt:
and then I launched with |
Also, I had to add this to
I also got an error on |
Yeah, pretty sure. I have a simple sample here and that still works. Do you see any errors or does the debugger break on any errors?
I usually just put it next to my extension sources, tho it shouldn't really matter as long as there is a "recent" version of |
The errors in |
FYI, I updated to c510eff and did a clean rebuild and everything looks good! |
Merging onto master such that it can be tried out easier. |
@jrieken as I understand it, this selects the correct provider based on the URI authority (host and port), correct? Wouldn't it make more sense to select it based on the URI scheme? E.g. have one handler for |
Totally! Just a lot harder to implement because for some reason our code makes a ton of assumptions on the |
It would be nice if extensions could specify in https://gist.github.com/sqs/3c8dc223d5d418f09cec4a68020d9038#file-remotefileservice-ts-L98 This requires the extension API We are trying out this new API and will hopefully have more patches/experiences to send along. So far, it's great. We've moved all of our remote file system code to an extension. |
Totally, the |
Reopening tabs upon vscode restart needs to work with remote files. I think this also needs schema activation events -- so that vscode can wait for the associated extension to activate, giving it a change to register a file system, before requesting that the remote file be loaded. |
Could we get some sort of "authority activation event" for now?
In the meantime, we could try keeping the set of open files from the
authority written to some scratch data and use that when VS Code reopens?
…On Thu, Jul 27, 2017 at 8:29 AM, CJ Bell ***@***.***> wrote:
Reopening tabs upon vscode restart needs to work with remote files.
I think this also needs schema activation events -- so that vscode can
wait for the associated extension to activate, giving it a change to
register a file system, before requesting that the remote file be loaded.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#30337 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAoB_f_7Xlxa6V73elBfw9W-VXJKbrNpks5sSKzGgaJpZM4OS6WU>
.
|
Unsure, while this is experimental I'd go with the |
No and unsure how we could make it work today... |
This is an experiment about allowing extensions to contribute something like a remote file system to VS Code. For now, only loading and storing is tackled, no discovery nor creation of files/folders. Also, only text files are considered for now, no binaries etc.
To try this have an extension (using proposed API*) that does the following:
*) Enable proposed API by having this line in your package.json
"enableProposedApi": true,
and for IntelliSense copy the most recent version ofvscode.proposed.d.ts
to your extension.