mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Improve quick input sample
This commit is contained in:
2
quickinput-sample/.vscode/launch.json
vendored
2
quickinput-sample/.vscode/launch.json
vendored
@ -6,7 +6,7 @@
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Extension",
|
||||
"name": "Run Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
|
||||
@ -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
|
||||
|
||||

|
||||
|
||||
# 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
|
||||
6
quickinput-sample/package-lock.json
generated
6
quickinput-sample/package-lock.json
generated
@ -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": {
|
||||
|
||||
@ -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';
|
||||
|
||||
Reference in New Issue
Block a user