Repository navigation
Merge ERRORS and HINTS in LSP computeDiagnostics - #9665
Closed
emilianbold wants to merge 1 commit into
Closed
emilianbold wants to merge 1 commit into
emilianbold wants to merge 1 commit into
Conversation
When both kinds were requested, the HINTS assignment overwrote the ERRORS list instead of merging into it, so compilation errors never reached the client. Make the result list mutable and accumulate both kinds with addAll. Assisted-by: Z.ai GLM Latest
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new aggregation duplicates errors because computeDiags already returns merged diagnostics.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates LSP diagnostic collection to combine requested error and hint results.
Changes:
- Uses a mutable result list.
- Appends diagnostics from each requested kind.
| File | Description |
|---|---|
TextDocumentServiceImpl.java |
Changes diagnostic result aggregation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
2153
to
+2157
| if (types.contains(ErrorProvider.Kind.ERRORS)) { | ||
| result = computeDiags(uri, -1, ErrorProvider.Kind.ERRORS, originalVersion, docHolder); | ||
| result.addAll(computeDiags(uri, -1, ErrorProvider.Kind.ERRORS, originalVersion, docHolder)); | ||
| } | ||
| if (types.contains(ErrorProvider.Kind.HINTS)) { | ||
| result = computeDiags(uri, -1, ErrorProvider.Kind.HINTS, originalVersion, docHolder); | ||
| result.addAll(computeDiags(uri, -1, ErrorProvider.Kind.HINTS, originalVersion, docHolder)); |
Member
Author
|
The issue is invalid. Closing PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

When both kinds were requested, the HINTS assignment overwrote the ERRORS list instead of merging into it, so compilation errors never reached the client. Make the result list mutable and accumulate both kinds with addAll.
Assisted-by: Z.ai GLM Latest
^Add meaningful description above
Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
LLMs, Commit messages and PR description:
git log) that all commits have a valid name and email address for you in the Author field.Assisted-by: MODEL_NAME MODEL_VERSIONline appended to the commit message.Assisted-byline from above)If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)