From 760e416252298416a3c164d53427bf63248269e5 Mon Sep 17 00:00:00 2001 From: Darien Pardinas Diaz Date: Mon, 29 Jul 2024 12:23:08 -0400 Subject: [PATCH] 0.0.7 Added custom.showInputBox --- CHANGELOG.md | 4 ++++ README.md | 1 + package.json | 2 +- src/services/requestProcessor.ts | 4 ++++ src/test/workspace1/samples.http | 13 +++++++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d7a1b3..aa0d7a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/README.md b/README.md index d31c031..701f136 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index 96a02d3..56dc9ab 100644 --- a/package.json +++ b/package.json @@ -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" }, diff --git a/src/services/requestProcessor.ts b/src/services/requestProcessor.ts index 317ee5e..6ad94b9 100644 --- a/src/services/requestProcessor.ts +++ b/src/services/requestProcessor.ts @@ -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; diff --git a/src/test/workspace1/samples.http b/src/test/workspace1/samples.http index 2aee669..3dda0d1 100644 --- a/src/test/workspace1/samples.http +++ b/src/test/workspace1/samples.http @@ -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" + }] +}