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
Provide API to open a new folder #58
Comments
We should make the underlying command API/documented |
@jrieken I am worried though that our commands leak into the API. how can I ensure that my internal command "Open Folder" does not break the assumed API contract of being able to pass in the folder to open? I think if we allow arguments to be passed to a command, the command itself must move into a location where it is very clear that any change to the constructor is a breaking API change. |
@bpasero Yes, the commands will become API. As they are already today by the keybindings-config. IMO we should have a list of commands that we consider stable including identifier, args, and return-type if applicable. |
@jrieken I would still feel more comfortable having explicit API in vscode.d.ts to open a folder, this could be on the window namespace. |
Disagree because the API should stay compact. Also more commands will enable more flexible scenarios like macros etc. I think a rule of thumb could be make a function API if it returns a meaningful and hard to compute result |
An API for opening a folder is the last cog in a wheel (and the most crucial) for an extension I'm writing. Would love a couple APIs landed to open a folder with:
Using nodejs's
|
Optimistically adding for April - stretch tho. |
Pushed for April, the syntax via command is: let uri = vscode.Uri.parse('file:///Users/bpasero/Development/Microsoft/monaco');
vscode.commands.executeCommand('vscode.openFolder', uri); Note that opening a folder will replace the current running instance and this means the currently executing extension host will go down and restart. |
@bpasero While I do welcome this API addition and really appreciate its inclusion, I'm not seeing any changes here on providing an API for opening a new window with a Any chance that could land as well? P.S. Sorry for resurfacing a "closed" issue, I just don't feel all the cases were addressed 😄 |
+1, will add a flag. |
@bpasero Hey, was this ever landed in Insider Preview / 1.0.0 (p.s. congrats on the release everyone) alongside the flag you mentioned you'd add? |
@JoshStrobl no, this is post 1.0 |
This is essential to creating a project manager extension, it would be best if there was the option to open in a new instance or an existing instance of code.
The text was updated successfully, but these errors were encountered: