Improve quick input sample

This commit is contained in:
Pine Wu
2019-09-10 15:05:39 -07:00
parent 5c3010f375
commit 063946acc0
4 changed files with 23 additions and 10 deletions

View File

@ -6,7 +6,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",

View File

@ -1,7 +1,5 @@
# QuickInput Sample
NOTE: This extension is using API in 'proposed' stage in VS Code 1.25. Please provide feedback in issue [#49340](https://github.com/Microsoft/vscode/issues/49340).
This is a sample extension that shows the QuickInput UI and usage of the QuickInput API.
It is not intended as a production quality extension.
@ -10,13 +8,29 @@ It is not intended as a production quality extension.
- Run "Quick Input Samples"
- Pick one of the samples and see it run
## Demo
![Multi-step sample](https://raw.githubusercontent.com/Microsoft/vscode-extension-samples/master/quickinput-sample/preview.gif)
# How it works, what it shows?
## How it works
- The extension uses the [`QuickPick`](https://code.visualstudio.com/api/references/vscode-api#QuickPick) and [`InputBox`](https://code.visualstudio.com/api/references/vscode-api#InputBox) API to show a UI for user input.
- Registers a command via `package.json` that will trigger the task
- Registers a command via `package.json` that will trigger the quick input
## VS Code API
### `vscode` module
- [`QuickPick`](https://code.visualstudio.com/api/references/vscode-api#QuickPick)
- [`InputBox`](https://code.visualstudio.com/api/references/vscode-api#InputBox)
- [`window.createQuickPick`](https://code.visualstudio.com/api/references/vscode-api#window.createQuickPick)
- [`window.showQuickPick`](https://code.visualstudio.com/api/references/vscode-api#window.showQuickPick)
- [`window.createInputBox`](https://code.visualstudio.com/api/references/vscode-api#window.createInputBox)
- [`window.showInputBox`](https://code.visualstudio.com/api/references/vscode-api#window.showInputBox)
# How to run locally
* open this folder in VS Code and press `F5`
- Run `npm install` in terminal to install dependencies
- Run the `Run Extension` target in the Debug View. This will:
- Start a task `npm: watch` to compile the code
- Run the extension in a new VS Code window

View File

@ -308,9 +308,9 @@
}
},
"typescript": {
"version": "3.4.5",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz",
"integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==",
"version": "3.6.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.3.tgz",
"integrity": "sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==",
"dev": true
},
"wrappy": {

View File

@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { window, commands, ExtensionContext } from 'vscode';
import { showQuickPick, showInputBox } from './basicInput';
import { multiStepInput } from './multiStepInput';