| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- syntax = "proto3";
- package host;
- option go_package = "github.com/cline/grpc-go/host";
- option java_multiple_files = true;
- option java_package = "bot.cline.host.proto";
- // Provides methods for working with IDE windows and editors.
- service WindowService {
- // Opens a text document in the IDE editor and returns editor information.
- rpc showTextDocument(ShowTextDocumentRequest) returns (TextEditorInfo);
- // Shows the open file dialogue / file picker.
- rpc showOpenDialogue(ShowOpenDialogueRequest) returns (SelectedResources);
- // Shows a notification.
- rpc showMessage(ShowMessageRequest) returns (SelectedResponse);
- // Prompts the user for input and returns the response.
- rpc showInputBox(ShowInputBoxRequest) returns (ShowInputBoxResponse);
- // Shows the file save dialogue / file picker.
- rpc showSaveDialog(ShowSaveDialogRequest) returns (ShowSaveDialogResponse);
- // Opens a file in the IDE.
- rpc openFile(OpenFileRequest) returns (OpenFileResponse);
- // Opens the host settings UI, optionally focusing a specific query/section.
- rpc openSettings(OpenSettingsRequest) returns (OpenSettingsResponse);
- // Returns the open tabs.
- rpc getOpenTabs(GetOpenTabsRequest) returns (GetOpenTabsResponse);
- // Returns the visible tabs.
- rpc getVisibleTabs(GetVisibleTabsRequest) returns (GetVisibleTabsResponse);
- // Returns information about the current editor
- rpc getActiveEditor(GetActiveEditorRequest) returns (GetActiveEditorResponse);
- }
- message ShowTextDocumentRequest {
- 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 {
- 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 {
- ShowMessageType type = 1;
- string message = 2;
- optional ShowMessageRequestOptions options = 3;
- }
- message ShowMessageRequestOptions {
- repeated string items = 1;
- optional bool modal = 2;
- optional string detail = 3;
- }
- message SelectedResponse {
- optional string selected_option = 1;
- }
- message ShowSaveDialogRequest {
- optional ShowSaveDialogOptions options = 1;
- }
- message ShowSaveDialogOptions {
- optional string default_path = 1;
- // A map of file types to extensions, e.g
- // "Text Files": { "extensions": ["txt", "md"] }
- map<string, FileExtensionList> filters = 2;
- }
- message FileExtensionList {
- // A list of file extension (without the dot).
- repeated string extensions = 1;
- }
- message ShowSaveDialogResponse {
- // If the user cancelled the dialog, this will be empty.
- optional string selected_path = 1;
- }
- message ShowInputBoxRequest {
- string title = 1;
- optional string prompt = 2;
- optional string value = 3;
- }
- message ShowInputBoxResponse {
- optional string response = 1;
- }
- message OpenFileRequest {
- string file_path = 1;
- }
- message OpenFileResponse {}
- message OpenSettingsRequest {
- // Optional query to focus a particular settings section/key.
- // This value is host-specific. In VS Code, it is passed directly as the
- // Settings search query to the "workbench.action.openSettings" command.
- // Examples (VS Code, see - https://code.visualstudio.com/docs/getstarted/settings#settings-editor-filters.):
- // - "telemetry.telemetryLevel" → focuses the Telemetry Level setting
- // - "@id:telemetry.telemetryLevel" → navigates by exact setting id
- // - "@modified", "@ext:publisher.extension"
- // - Plain keywords/categories
- // If not provided the host opens the settings UI without specific focus.
- optional string query = 1;
- }
- message OpenSettingsResponse {}
- message GetOpenTabsRequest {}
- message GetOpenTabsResponse {
- repeated string paths = 1;
- }
- message GetVisibleTabsRequest {}
- message GetVisibleTabsResponse {
- repeated string paths = 1;
- }
- message GetActiveEditorRequest {}
- message GetActiveEditorResponse {
- optional string file_path = 1;
- }
|