microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.22k stars 28.55k forks source link

Download Code from Currently Opened Folder in VSCode Workspace #208678

Open EvanR-Dev opened 5 months ago

EvanR-Dev commented 5 months ago

Currently in VSCode.dev, the user has the option to download their currently opened code in the workspace to their local machine: image They can then select which folder in their local machine they want this code to be downloaded to. It appears that this feature is implemented by VSCode itself. Is it possible that this can be exposed to where those developing VSCode extensions can use this feature? For example, this can be exposed via a command that can be used with other components

connor4312 commented 5 months ago

This is a request from Azure Functions ^

EvanR-Dev commented 3 months ago

@lramos15 Any update on this? Thanks

lramos15 commented 3 months ago

No progress. Is the ask for extension to be able to download arbitrary data to the users machine?

EvanR-Dev commented 1 month ago

@lramos15 It's about exposing the option to "Download" the code programmatically - without having the user click this button. Something such as a VS Code workbench command that would download their workspace code as a zip for example would work

We have this view that will make it easier to get started. The "Save project code" button here is limited because clicking on it gives the user a message popup to right click their workspace and select "Download..." - seen in screenshot in the initial post. Ideally - we want this to happen automatically but the functionality the "Download..." button exposes is not available today to my knowledge image

EvanR-Dev commented 3 weeks ago

@lramos15 ICYMI. Thanks

lramos15 commented 3 weeks ago

Have you tried executing the explorer.download' command from your extension?

EvanR-Dev commented 3 weeks ago

@lramos15 I see - this is what we're looking for but is there a way to select only specific files/folders to download that are in the workspace? Are there docs on this cmd?

lramos15 commented 3 weeks ago

There are not. This command is very explorer scoped, as evidence by the name. It takes the explorer selection and downloads that otherwise it downloads the whole workspace. This feature request you filed as I understand it would be to expand this to take a list of URIs to download or something similar but it is not currently prioritized and is on the backlog.