Skip to content

fix: Reschedule diagnostics refresh on modification-stamp mismatch - #1666

Merged
angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:fix/diagnostics-stop-refreshing-after-dropped-update
Sep 14, 2026
Merged

angelozerr merged 1 commit into
redhat-developer:mainfrom
angelozerr:fix/diagnostics-stop-refreshing-after-dropped-update

Conversation

@angelozerr

Copy link
Copy Markdown
Contributor

Fixes: #1665

Since commit fa5764c, LSPDiagnosticsApplier.applyHighlights() silently drops the update when the document modification stamp has changed between
collection and apply. Because OpenedDocument.updateDiagnostics() only calls scheduleRefresh when the diagnostic set actually changes, subsequent identical publishDiagnostics notifications are treated as unchanged and never re-applied, leaving stale squiggles in the editor.

Fix: on stamp mismatch, reschedule a new refresh via scheduleRefresh() instead of returning. The existing coalesceBy() ensures rapid reschedules during continuous typing are coalesced, not piled up. Once the user stops typing, the stamp matches and diagnostics apply normally.

@angelozerr angelozerr changed the title Fix: Reschedule diagnostics refresh on modification-stamp mismatch fix: Reschedule diagnostics refresh on modification-stamp mismatch Sep 14, 2026
Fixes: redhat-developer#1665

Since commit fa5764c, LSPDiagnosticsApplier.applyHighlights() silently
drops the update when the document modification stamp has changed
between
collection and apply. Because OpenedDocument.updateDiagnostics() only
calls scheduleRefresh when the diagnostic set actually changes,
subsequent identical publishDiagnostics notifications are treated as
unchanged and never re-applied, leaving stale squiggles in the editor.

Fix: on stamp mismatch, reschedule a new refresh via scheduleRefresh()
instead of returning. The existing coalesceBy() ensures rapid
reschedules during continuous typing are coalesced, not piled up. Once
the user stops typing, the stamp matches and diagnostics apply normally.

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr
angelozerr force-pushed the fix/diagnostics-stop-refreshing-after-dropped-update branch from 08f48c4 to c7b4c1b Compare September 14, 2026 09:16
@angelozerr angelozerr assigned angelozerr and unassigned angelozerr Sep 14, 2026
@angelozerr
angelozerr merged commit 80b94d8 into redhat-developer:main Sep 14, 2026
6 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.

Diagnostics stop refreshing after a dropped LSPDiagnosticsApplier update (stale squiggle survives until the diagnostic set changes)

1 participant