Skip to content
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

Closed
Tyriar opened this issue Nov 18, 2015 · 12 comments
Closed

Provide API to open a new folder #58

Tyriar opened this issue Nov 18, 2015 · 12 comments
Labels
api feature-request Request for new features or functionality
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Nov 18, 2015

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.

@bpasero bpasero self-assigned this Nov 18, 2015
@jrieken
Copy link
Member

jrieken commented Nov 19, 2015

We should make the underlying command API/documented

@bpasero
Copy link
Member

bpasero commented Nov 19, 2015

@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.

@jrieken
Copy link
Member

jrieken commented Nov 19, 2015

@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.

@bpasero
Copy link
Member

bpasero commented Nov 19, 2015

@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.

@jrieken
Copy link
Member

jrieken commented Nov 19, 2015

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

@bpasero bpasero added the feature-request Request for new features or functionality label Nov 19, 2015
@egamma egamma modified the milestone: Backlog Dec 10, 2015
@JoshStrobl
Copy link

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:

  1. A new window, maybe defined as (vscode.window.openNewWindow(uri : vscode.Uri)
  2. Current workspace, maybe defined as (vscode.workspace.openFolder(uri : vscode.Uri)

Using nodejs's child_process isn't really viable, because:

  1. Even when "detached", it is still a child process.
  2. Starts the instance (I'm provided a PID) however doesn't actually render.

@Tyriar Tyriar added the api label Mar 31, 2016
@jrieken jrieken modified the milestones: April 2016, Backlog Apr 1, 2016
@jrieken jrieken self-assigned this Apr 1, 2016
@jrieken
Copy link
Member

jrieken commented Apr 1, 2016

Optimistically adding for April - stretch tho.

@bpasero
Copy link
Member

bpasero commented Apr 4, 2016

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 bpasero closed this as completed Apr 4, 2016
bpasero added a commit that referenced this issue Apr 4, 2016
* Provide API to open a new folder (fixes #58)

* extract more generic command

* use underscore to prevent command from showing in keybindings list
@JoshStrobl
Copy link

@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 vscode.Uri provided (see my comment above).

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 😄

@bpasero
Copy link
Member

bpasero commented Apr 5, 2016

+1, will add a flag.

@JoshStrobl
Copy link

@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?

@bpasero
Copy link
Member

bpasero commented Apr 15, 2016

@JoshStrobl no, this is post 1.0

@jrieken jrieken removed their assignment Apr 25, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants