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

0.0.7 Added custom.showInputBox to collect string input from the user #4

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## [0.0.7]

- Added `custom.showInputBox` to show input box dialog to collect a input string from the user

## [0.0.6]

- Added `custom.getExtensionInfo` to get specific information about an extension by passing the extension ID as parameter. Use `custom.listInstalledExtensions`to list all installed extensions.
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ As the extension progresses, I plan to add more _special_ commands (i.e. command
- `custom.startDebugSession`: allows you to invoke `vscode.debug.startDebugging()` API by passing the workspace folder and a name or definition of a debug configuration as it would be set in `launch.json`
- `custom.runInTerminal`: allows you to invoke commands the currently active integrated terminal
- `custom.showQuickPick`: show quick pick dialog to collect selection from the user
- `custom.showInputBox`: show input box dialog to collect a input string from the user
- `custom.showInformationMessage`, `custom.showWarningMessage` and `custom.showErrorMessage`: show message dialogs to the user and let them click on a button
- `custom.listInstalledExtensions`: get the list of installed extension IDs
- `custom.getExtensionInfo`: get details of an installed extension by passing the extension ID
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "This extension allows you to remotely control Visual Studio Code via a REST endpoint, taking automation to the next level.",
"publisher": "dpar39",
"license": "MIT",
"version": "0.0.6",
"version": "0.0.7",
"engines": {
"vscode": "^1.55.0"
},
Expand Down
4 changes: 4 additions & 0 deletions src/services/requestProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ export async function processRemoteControlRequest(requestObject: ControlRequest)
return await quickPick(args[0]);
}

if (command === "custom.showInputBox") {
return await vscode.window.showInputBox(args[0]);
}

if (command === "custom.goToFileLineCharacter") {
const filePath = args[0];
let uri = null;
Expand Down
13 changes: 13 additions & 0 deletions src/test/workspace1/samples.http
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,16 @@ content-type: application/json
"command": "workbench.action.reloadWindow",
"args": []
}

### Show input box and collect response
POST {{endpoint}} HTTP/1.1
content-type: application/json

{
"command": "custom.showInputBox",
"args": [{
"title": "Collect user info",
"value": "replace me please",
"placeHolder": "Enter some text here"
}]
}
Loading