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

Add an API for showing Wizards and Dialog Boxes #28395

Closed
maddouri opened this issue Jun 9, 2017 · 1 comment
Closed

Add an API for showing Wizards and Dialog Boxes #28395

maddouri opened this issue Jun 9, 2017 · 1 comment
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s)

Comments

@maddouri
Copy link

maddouri commented Jun 9, 2017

Currently, in order to get any information from the user, an extension has the following options:

  • showInputBox()
  • showQuickPick()

Both of those methods allow getting a single piece of information. (as opposed to a form containing multiple fields for the user to fill in)

While this is particularly efficient for getting simple data. (e.g. a "Rename" command might use showInputBox() to get the new name of a variable) it is (IMHO) rather inconvenient for getting more complex information.

For instance, if an extension wants to show a "wizard" that creates a new project in the currently open directory, an intuitive way would be to show a "window" that allows the user to fill in such parameters as:

  1. Project name
  2. The version of the language/standard to use
  3. Project template
  4. etc.

Since, VSCode doesn't provide an API for showing custom windows, the only way for getting these information would be to show consecutive input boxes. (using showInputBox())
This means:

  1. The user has to remember what they have entered
  2. If the user remembers making a mistake in a previously validated input box, they have to cancel and start over

A concrete example of such behavior can be seen in the yo extension.

Having all the fields displayed simultaneously would allow the user to:

  1. Write AND correct themselves without having to start all over each time they make a mistake
  2. Have a recap of all the information that has been entered and make changes if needed

Some extensions (e.g. CMake Tools) are working around this limitation by:

  1. Showing an HTML page that contains input fields, buttons, etc. (implementing TextDocumentContentProvider)
  2. Getting the information back using an HTTP server and WebSockets
  3. (Perhaps, I haven't checked, but seems doable) Updating the content of the HTML page if needed

Clever!
I think, however, that it would be better if VSCode provided some API for showing simple, custom windows that would (at least) allow getting multiple data at once.

Some ideas:

  • showForm([{fieldName: "name", fieldType: "type"}...], okCallback, cancelCallback)
  • showDialog(message, okCallback)
  • showFancyWindow(be, creative)
@maddouri maddouri changed the title Add an API for for showing Wizards and Dialog Boxes Add an API for showing Wizards and Dialog Boxes Jun 10, 2017
@jrieken
Copy link
Member

jrieken commented Jun 13, 2017

dups #9936 and #13807

@jrieken jrieken closed this as completed Jun 13, 2017
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Jun 13, 2017
@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 *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants