mirror of
https://github.com/cline/cline.git
synced 2026-09-24 23:20:16 +08:00
* host bridge migration: showErrorMessage & showInformationMessage & showWarningMessage Introduces the `showMessage` host API to the VS Code extension, allowing the host to display informational, warning, and error messages to the user. The changes include: - A new `ShowMessageRequest` and `SelectedResponse` message definition in `proto/host/window.proto` to define the request and response structure for showing messages. - A new file `src/hosts/vscode/window/showMessage.ts` that implements the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions. These functions use the VS Code API to display messages based on the `ShowMessageRequest`. - Replace all current call sites with the new implementations * define the request structure This commit introduces the `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` host APIs to the VS Code extension. These APIs allow the host to display informational, warning, and error messages to the user. The changes include: - Added `ShowErrorMessageRequest`, `ShowInformationMessageRequest`, and `ShowWarningMessageRequest` message definitions in `proto/host/window.proto` to define the request structure for showing messages. - Added new files `src/hosts/vscode/window/showErrorMessage.ts`, `src/hosts/vscode/window/showInformationMessage.ts`, and `src/hosts/vscode/window/showWarningMessage.ts` that implement the corresponding functions. These functions use the VS Code API to display messages based on the provided message and options. * Simplify showMessage functions and use options array The `showErrorMessage`, `showInformationMessage`, and `showWarningMessage` functions in `src/hosts/vscode/window/` have been refactored for simplification. - The functions now directly destructure the `modal`, `detail`, and `items` properties from the input object. - The VS Code API calls now directly pass the `modal` and `detail` options, and use the spread operator to pass the `items.options` array as additional arguments. This removes the need for conditional logic to construct the options object. * wip: apply feedback * Update src/integrations/git/commit-message-generator.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * merge conflict --------- Co-authored-by: abeatrix <beatrix@cline.bot> Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
73 lines
1.7 KiB
Protocol Buffer
73 lines
1.7 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package host;
|
|
option java_package = "bot.cline.host.proto";
|
|
option java_multiple_files = true;
|
|
|
|
import "common.proto";
|
|
|
|
// Provides methods for working with IDE windows and editors.
|
|
service WindowService {
|
|
// Opens a text document in the editor and returns editor information.
|
|
rpc showTextDocument(ShowTextDocumentRequest) returns (TextEditorInfo);
|
|
rpc showOpenDialogue(ShowOpenDialogueRequest) returns (SelectedResources);
|
|
rpc showMessage(ShowMessageRequest) returns (SelectedResponse);
|
|
}
|
|
|
|
message ShowTextDocumentRequest {
|
|
cline.Metadata metadata = 1;
|
|
string path = 2;
|
|
optional ShowTextDocumentOptions options = 3;
|
|
}
|
|
|
|
// See https://code.visualstudio.com/api/references/vscode-api#TextDocumentShowOptions
|
|
message ShowTextDocumentOptions {
|
|
optional bool preview = 1;
|
|
optional bool preserve_focus = 2;
|
|
optional int32 view_column = 3;
|
|
}
|
|
|
|
message TextEditorInfo {
|
|
string document_path = 1;
|
|
optional int32 view_column = 2;
|
|
bool is_active = 3;
|
|
}
|
|
|
|
message ShowOpenDialogueRequest {
|
|
cline.Metadata metadata = 1;
|
|
optional bool can_select_many = 2;
|
|
optional string open_label = 3;
|
|
optional ShowOpenDialogueFilterOption filters = 4;
|
|
}
|
|
|
|
message ShowOpenDialogueFilterOption {
|
|
repeated string files = 1;
|
|
}
|
|
|
|
message SelectedResources {
|
|
repeated string paths = 1;
|
|
}
|
|
|
|
enum ShowMessageType {
|
|
ERROR = 0;
|
|
INFORMATION = 1;
|
|
WARNING = 2;
|
|
}
|
|
|
|
message ShowMessageRequest {
|
|
cline.Metadata metadata = 1;
|
|
ShowMessageType type = 2;
|
|
string message = 3;
|
|
optional ShowMessageRequestOptions options = 4;
|
|
}
|
|
|
|
message ShowMessageRequestOptions {
|
|
repeated string items = 1;
|
|
optional bool modal = 2;
|
|
optional string detail = 3;
|
|
|
|
}
|
|
|
|
message SelectedResponse {
|
|
optional string selected_option = 1;
|
|
} |