-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Host bridge migration: showErrorMessage, showInformationMessage, showWarningMessage #4745
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
Conversation
…owWarningMessage 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
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors all direct vscode.window.show*Message
calls to use the new host bridge API (showErrorMessage
, showInformationMessage
, showWarningMessage
) and adds corresponding Protobuf definitions and wrapper implementations.
- Introduces new wrapper functions in
src/hosts/vscode/window
and updates the Protobufwindow.proto
definitions. - Replaces all existing
vscode.window.show*Message
calls with the new host bridge calls across the codebase. - Updates tests and import statements to reference the new wrappers.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
src/hosts/vscode/window/show*.ts | Added host bridge wrappers for error/info/warning messages |
proto/host/window.proto | Defined ShowErrorMessageRequest , ShowInformationMessageRequest , ShowWarningMessageRequest , and shared message types |
**/*.ts (various) |
Replaced direct VSCode UI calls with the new wrapper functions |
src/test/extension.test.ts | Updated test cleanup to use showInformationMessage wrapper |
Coverage ReportExtension CoverageBase branch: 46% PR branch: 46% ✅ Coverage increased or remained the same Webview CoverageBase branch: 13% PR branch: 13% ✅ Coverage increased or remained the same Overall Assessment✅ Test coverage has been maintained or improved Last updated: 2025-07-11T22:36:00.782521 |
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.
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…exts (cline#4745) (cline#4748) Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks Bee
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick stamp for reapprove after merge conflicts, did not review properly but it has been tested by andrei
…WarningMessage (cline#4745) * 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>
@abeatrix Could these be separate PRs in the future? 🙏 🙏 |
…WarningMessage (cline#4745) * 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>
Related Issue
Issue: #XXXX
Description
Introduces the
showMessage
host API to the host bridge for displaying informational, warning, and error messages to the user in clients.The changes include:
ShowMessageRequest
andSelectedResponse
message definition inproto/host/window.proto
to define the request and response structure for showing messages.src/hosts/vscode/window/showMessage.ts
that implements theshowErrorMessage
,showInformationMessage
, andshowWarningMessage
functions. These functions use the VS Code API to display messages based on theShowMessageRequest
.Test Procedure
Reset Workspace State
in debugger to confirm the window messages are showing up as expected:Type of Change
Pre-flight Checklist
npm test
) and code is formatted and linted (npm run format && npm run lint
)npm run changeset
(required for user-facing changes)Screenshots
Additional Notes
Important
Introduces a unified
showMessage
API for consistent message handling across the codebase, replacing direct VS Code message calls.showMessage
API inproto/host/window.proto
for displaying messages.vscode.window.showErrorMessage
,showInformationMessage
, andshowWarningMessage
withshowMessage
increateRuleFile.ts
,deleteRuleFile.ts
,index.ts
,resetState.ts
,updateDefaultTerminalProfile.ts
,deleteAllTaskHistory.ts
,deleteTasksWithIds.ts
,index.ts
(mentions),index.ts
(webview),tasks.ts
,extension.ts
,showMessage.ts
,commit-message-generator.ts
,export-markdown.ts
,open-file.ts
,process-files.ts
, andMcpHub.ts
.ShowMessageRequest
,ShowMessageType
, andSelectedResponse
toproto/host/window.proto
.showMessage
function inshowMessage.ts
to handle message display logic.showMessage
API for consistency and maintainability.This description was created by
for 23d81d1. You can customize this summary. It will automatically update as commits are pushed.