Skip to content

Conversation

@YueCHEN195
Copy link
Contributor

@YueCHEN195 YueCHEN195 commented Dec 18, 2025

What it does

Implemented conversion for the data field in the diagnostic <-> marker lifecycle by updating convertDiagnosticToMarkerData and reviveMarker, enabling ProblemManager markers to carry the data payload. The data field is an opaque, server-defined payload used to attach metadata to a diagnostic and must be preserved by the client. This field is defined on the Diagnostic interface in the vscode-languageserver-protocol package as below:

image

How to test

  1. Prepare an LSP server or mock that publishes diagnostics including a data property (LSP 3.16+).
  2. Open a workspace/file that receives those diagnostics.
  3. Verify that ProblemManager exposes markers whose data field is present and matches the published diagnostic data.
  4. Inspect markers via the UI or programmatic API that uses MarkerManager.findMarkers() and check marker.data.data contains the expected value.
image

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@github-project-automation github-project-automation bot moved this to Waiting on reviewers in PR Backlog Dec 18, 2025
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Seems to work well 👍

Comment on lines 10346 to 10349
/**
* A data entry field that is preserved between diagnostics and code actions.
*/
data?: LSPAny;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: The original implementation does not contain this field. Adding it here will result in a mismatch between our interfaces and the one from VSCode, see also our comparison report.

If you want to add it (for typing reasons), please add this to the theia-extra.d.ts file.

endColumn: number;
relatedInformation?: RelatedInformation[];
tags?: MarkerTag[];
data?: LSPAny;
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: Since this value can stem from non-LSP sources, it doesn't really make sense to use LSPAny here. Simply use any.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@msujew Thanks for your Suggestion. I've addressed your comments. Please take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Waiting on reviewers

Development

Successfully merging this pull request may close these issues.

2 participants