Skip to content

Conversation

@smpanaro
Copy link

@smpanaro smpanaro commented Nov 17, 2025

Closes #41935

It seems the issue was not related to the tag, but instead caused when all the diagnostics for a file are DiagnosticSeverity Hint and/or Information. In that case they are cleared because the summary only includes Warning and Error.

I tested this following the steps in the issue for the local case, and updated some existing tests for the remote/collab case.

Release Notes:

  • Fixed file diagnostics being cleared when none have severity >= warning

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 17, 2025
let new_summary = DiagnosticSummary::new(&diagnostics);
if new_summary.is_empty() {
if diagnostics.is_empty() {
if let Some(diagnostics_by_server_id) = diagnostics_for_tree.get_mut(&path_in_worktree)
Copy link
Author

Choose a reason for hiding this comment

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

One unrelated thing I noticed but wasn't sure about was that in this branch summaries_by_server_id.insert isn't updated. It doesn't seem to matter for this particular issue so left it as is.

@smpanaro

This comment was marked as outdated.

@smpanaro
Copy link
Author

Seems this broke a couple tests, which I've fixed.

I think it also exposed a different issue for non-open files, those without a buffer, where a streaming workspace diagnostic pull would discard previously pushed diagnostics (as opposed to the the non-streaming case where they are kept). I think that behavior makes sense to me so applied it, but willing to change it.

I left one TODO on some code that felt a little duplicative, may circle back but might also wait for PR feedback :)

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

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DiagnosticTag.Unnecessary diagnostics not persisted

1 participant