Compare commits

...

4 Commits

Author SHA1 Message Date
abeatrix 2d91bf7937 Remove undefined handler for ShowInputBoxResponse 2025-07-22 00:17:07 -07:00
abeatrix 6954b532ba merge main 2025-07-21 23:41:22 -07:00
abeatrix 563606c8a8 Simplify 2025-07-15 18:24:35 -07:00
abeatrix f250f1652f Update showInputBox 2025-07-14 22:37:41 -07:00
3 changed files with 32 additions and 7 deletions
+12
View File
@@ -12,6 +12,7 @@ service WindowService {
rpc showTextDocument(ShowTextDocumentRequest) returns (TextEditorInfo);
rpc showOpenDialogue(ShowOpenDialogueRequest) returns (SelectedResources);
rpc showMessage(ShowMessageRequest) returns (SelectedResponse);
rpc showInputBox(ShowInputBoxRequest) returns (ShowInputBoxResponse);
rpc showSaveDialog(ShowSaveDialogRequest) returns (ShowSaveDialogResponse);
}
@@ -90,3 +91,14 @@ message FileExtensionList {
message ShowSaveDialogResponse {
optional string selected_path = 1;
}
message ShowInputBoxRequest {
cline.Metadata metadata = 1;
string title = 2;
optional string prompt = 3;
optional string value = 4;
}
message ShowInputBoxResponse {
optional string response = 1;
}
+9 -7
View File
@@ -4,7 +4,7 @@ import * as path from "path"
import { Controller } from "@core/controller"
import { HistoryItem } from "@shared/HistoryItem"
import { ClineMessage } from "@shared/ExtensionMessage"
import { ShowMessageRequest, ShowMessageType } from "@/shared/proto/host/window"
import { ShowMessageType } from "@/shared/proto/host/window"
import { HostProvider } from "@/hosts/host-provider"
/**
@@ -14,13 +14,15 @@ import { HostProvider } from "@/hosts/host-provider"
export function registerTaskCommands(context: vscode.ExtensionContext, controller: Controller): vscode.Disposable[] {
return [
vscode.commands.registerCommand("cline.dev.createTestTasks", async () => {
const count = await vscode.window.showInputBox({
title: "Test Tasks",
prompt: "How many test tasks to create?",
value: "10",
})
const count = (
await HostProvider.window.showInputBox({
title: "Test Tasks",
prompt: "How many test tasks to create?",
value: "10",
})
).response
if (!count) {
if (count === undefined) {
return
}
@@ -0,0 +1,11 @@
import * as vscode from "vscode"
import { ShowInputBoxRequest, ShowInputBoxResponse } from "@/shared/proto/index.host"
export async function showInputBox(request: ShowInputBoxRequest): Promise<ShowInputBoxResponse> {
const response = await vscode.window.showInputBox({
title: request.title,
prompt: request.prompt,
value: request.value,
})
return ShowInputBoxResponse.create({ response })
}