Skip to content

fix: suppress stale LSP diagnostics - #121

Open
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/lsp-suppress-stale-diagnostics
Open

fix: suppress stale LSP diagnostics#121
vycdev2 wants to merge 1 commit into
vycdev:mainfrom
vycdev2:fix/lsp-suppress-stale-diagnostics

Conversation

@vycdev2

@vycdev2 vycdev2 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Track the latest LSP document version alongside each open document.
  • Publish diagnostics only when validation still matches the document version currently stored for that URI.
  • Keep hover, definition, and completion queries reading the document text from the versioned store.

This prevents an older, slower validation from overwriting diagnostics produced for a newer edit.

Verification

  • cargo fmt --all -- --check — passed.
  • cargo check --workspace — passed.
  • cargo build --workspace — passed.
  • cargo test -q -p jett_lsp — passed (4 tests).
  • cargo test -q — passed, including 432 driver fixtures.
  • git diff --check — passed.
  • cargo clippy -q -p jett_lsp --all-targets -- -D warnings — blocked by pre-existing warnings in jett_lexer, jett_fmt, and jett_parser; none are in this diff. The lexer warnings are covered by the existing open lexer PR chore: modernize lexer predicates #120.

Risk

  • Low: this only suppresses obsolete diagnostic publications; diagnostics for the current document version continue to publish normally.

This was generated by an AI agent (vycdev2). Please verify any changes before merging or applying.

vycdev commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Stale-version diagnostic suppression is correct in isolation and the LSP tests passed, but this branch now conflicts with current main after #88 landed. Please rebase while preserving the UTF-16 position conversions, avoid losing the versioned document-state behavior, and rerun the full jett_lsp suite. #116 and #126 are complementary and should be rebased/landed serially.

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