Skip to content

Hostbridge diff diagnostics #5368

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

Merged
merged 3 commits into from
Aug 6, 2025
Merged

Hostbridge diff diagnostics #5368

merged 3 commits into from
Aug 6, 2025

Conversation

kvyb
Copy link
Contributor

@kvyb kvyb commented Aug 5, 2025

Description

Migrate the diff edit diagnostics functionality from direct VS Code API calls to hostbridge.

Changes:

  • Add getDiagnostics RPC to DiffService in proto/host/diff.proto
  • Implement VS Code diagnostics handler in src/hosts/vscode/hostbridge/diff/getDiagnostics.ts
  • Update VscodeDiffViewProvider to use getAllDiagnostics() via hostbridge instead of direct vscode.languages.getDiagnostics()
  • Update @problems mention functionality to use hostbridge abstraction
  • Preserve complete before/after diff edit diagnostics comparison workflow

The diagnostics functionality now flows through: Client → HostProvider.diff.getDiagnostics() → gRPC → VS Code Implementation → Response, enabling other platforms to implement the same interface.

Test Procedure

  1. @problems mention testing: Verified @problems in chat triggers hostbridge call and displays workspace diagnostics correctly
  2. Diff edit diagnostics testing: Asked Cline to fix TypeScript errors in test file, confirmed:
    • Pre-edit diagnostics capture via hostbridge
    • Post-edit diagnostics capture via hostbridge
    • Before/after comparison logic works correctly
    • Successful execution after fixes applied

Verified hostbridge flow: Console logs showed complete gRPC request/response cycle with proper diagnostic data transformation between proto and VS Code formats. Both functionalities work identically to before, but now use hostbridge instead of direct VS Code APIs.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

Screenshot 2025-08-05 at 22 27 23

Important

Refactor diagnostics functionality to use hostbridge for cross-platform compatibility, adding a new RPC and updating related classes and functions.

  • Behavior:
    • Migrate diagnostics functionality to use hostbridge, enabling cross-platform compatibility.
    • Add getDiagnostics RPC to DiffService in proto/host/workspace.proto.
    • Implement VS Code diagnostics handler in src/hosts/vscode/hostbridge/workspace/getDiagnostics.ts.
    • Update VscodeDiffViewProvider and ExternalDiffViewProvider to use getDiagnostics() via hostbridge.
    • Update @problems mention functionality to use hostbridge abstraction.
  • Diagnostics:
    • Refactor getNewDiagnostics() and diagnosticsToProblemsString() in src/hosts/vscode/diagnostics.ts.
    • Add getWorkspaceProblemsString() in src/integrations/diagnostics/index.ts for cross-host compatibility.
  • Misc:
    • Ensure diagnostics comparison workflow remains intact before and after edits.

This description was created by Ellipsis for 5271789. You can customize this summary. It will automatically update as commits are pushed.

kvyb added 2 commits August 5, 2025 22:36
…s functionality from direct VS Code API calls to the hostbridge layer to enable multi-host support (VS Code + IntelliJ).
Copy link

changeset-bot bot commented Aug 5, 2025

⚠️ No Changeset found

Latest commit: 5271789

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kvyb kvyb requested review from sjf and removed request for Garoth, dcbartlett, ocasta181, saoudrizwan, saito-sv, pashpashpash and NightTrek August 5, 2025 14:48
Copy link
Contributor

github-actions bot commented Aug 5, 2025

Coverage Report

Extension Coverage

Base branch: 47%

PR branch: 48%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-08-06T01:19:52.490231

Copy link
Contributor

@sjf sjf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great except for the comment about the before and after diagnostics, but lets just submit this and fix it in a second PR.

@kvyb kvyb merged commit 1d4cd31 into main Aug 6, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants