-
Notifications
You must be signed in to change notification settings - Fork 30.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
Allow showOpenDialog
to open local files
#131138
Comments
There was some discussion somewhere about whether we should allow extensions to open local files on web which I now cannot find. If I remember correctly, the outcome of the discussion was that we wouldn't allow it for now because:
Now we have a real need for it now though. Given the potential for error here, we should consider making the local file option for vscode/src/vs/platform/dialogs/common/dialogs.ts Lines 101 to 107 in ee1655a
|
Sounds good. Let's dive into this more next iteration; Kai would like to get the referenced experience going by the end of this year :) |
Actually with the new approach with embedder-side code in vscode.dev I don't really need this -- I can have a custom command added in the embedder which opens a file and passes it back down. Having an API for this would make it simpler, though, and there may be other use cases, so I'll leave it open. |
I think this will still be eventually needed, but my particular use case is no longer required. |
@bpasero extension API still can't cause the "Show Local" button to show. |
Ah ok 👍 |
Proposal: vscode/src/vscode-dts/vscode.proposed.showLocal.d.ts Lines 10 to 18 in 1f4d6ea
|
alt name; |
showOpenDialog
to open local files on webshowOpenDialog
to open local files
* Propose "allowLocal" open dialog option API Part of microsoft#131138 * Update comment * allowUIResources API proposal Part of microsoft#131138 * Fix scheme ordering and update doc comment
Can the "web/remote" open file view be made available for opening local files also, through a setting? |
It already is! |
Did not know that! Thanks. |
The prototype this was for is not the direction we ended up going, so I don't need this any more, but it might be otherwise useful |
@connor4312 , If you're not using it, I'll delete the vscode.proposed file for it. Do you have another use for this? I haven't heard from any extension authors that need this. I'm inclined to clone as out of scope since I don't foresee us adding this any time soon. |
Not so far |
In the demo in https://github.com/microsoft/vscode-internalbacklog/issues/2178#issuecomment-901514989, I had to manually create a file in the web workspace since I couldn't figure out a way to get
vscode.window.showOpenDialog
to open a file on the user's machine. Rob suggested that adding afile:///
URI as thedefaultUri
might work, but it doesn't.Is opening a local file in this way already possible, and if not could we add a way for it to happen, perhaps using the defaultUri as Rob suggested?
The text was updated successfully, but these errors were encountered: