mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
37 lines
1.5 KiB
Markdown
37 lines
1.5 KiB
Markdown
# QuickInput Sample
|
|
|
|
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.
|
|
|
|
- Open the command palette
|
|
- Run "Quick Input Samples"
|
|
- Pick one of the samples and see it run
|
|
|
|
## Demo
|
|
|
|

|
|
|
|
## 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 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
|
|
|
|
- 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
|