Skip to content

Conversation

@Zacks-Zhang
Copy link

@Zacks-Zhang Zacks-Zhang commented Jan 30, 2026

Summary

  • Fix stale LSP diagnostics by syncing updated on-disk file contents to the language server after edits.
  • Add a focused unit test to ensure a previously opened file triggers a content update notification.

Changes

  • Updated src/tools/lsp/client.ts to:
    • Track per-document version numbers and last-synced text.
    • Send textDocument/didChange (full text) when a file that was already didOpen’d changes on disk.
    • Send textDocument/didSave after didChange to improve compatibility with servers that refresh diagnostics on save.
  • Added src/tools/lsp/client.test.ts to verify didChange is emitted when a previously opened file’s content changes.

Testing

bun run typecheck
bun test src/tools/lsp/*.test.ts

Related Issues

#1272


Summary by cubic

Fixes stale LSP diagnostics by syncing file changes for already-opened files via didChange and didSave. Addresses #1272.

  • Bug Fixes
    • Track per-document version and last-synced text.
    • Emit textDocument/didChange (full text) when an opened file’s content changes on disk.
    • Emit textDocument/didSave after didChange for servers that refresh on save.
    • Add a unit test that asserts didChange is sent for a previously opened file.

Written for commit 3bb4289. Summary will update on new commits.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 30, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@Zacks-Zhang
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 30, 2026
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

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.

1 participant