Skip to content

feat(lsp): implement real-time diagnostics and decouple core#59

Merged
sonesuke merged 4 commits into
mainfrom
feat/lsp-realtime-diagnostics
Feb 3, 2026
Merged

feat(lsp): implement real-time diagnostics and decouple core#59
sonesuke merged 4 commits into
mainfrom
feat/lsp-realtime-diagnostics

Conversation

@sonesuke
Copy link
Copy Markdown
Owner

@sonesuke sonesuke commented Feb 3, 2026

Summary

This PR implements real-time diagnostics updates for the LSP server and refactors the core module to remove dependencies on LSP types.

Changes

  • LSP Backend:
    • Implemented in-memory document synchronization to reflect changes immediately without saving.
    • Added logic to publish diagnostics for all workspace files to ensuring stale errors on closed files are cleared.
    • Implemented path canonicalization for reliable document overrides lookup.
  • Core Module:
    • Refactored check_workspace and collect_workspace_all to accept HashMap<PathBuf, String> for overrides, decoupling core from tower_lsp and dashmap.
    • Added path canonicalization handling in override lookups.
  • CLI:
    • Updated handlers to pass None for the new overrides argument in collect_workspace_all.

Verification

  • Verified manually in VS Code that diagnostics update in real-time and cross-file reference errors clear immediately upon fixing the definition.
  • Verified cargo check, cargo build, cargo fmt, and cargo clippy pass.

This PR implements real-time diagnostics updates for the LSP server and refactors the core module.

- Implement in-memory document synchronization in LSP backend

- Fix stale diagnostics by ensuring all workspace files receive diagnostic updates

- Decouple `core` module from `tower_lsp` by using `HashMap<PathBuf, String>` for overrides

- Implement path normalization (canonicalization) for reliable document lookup

- Update CLI handlers to match new `collect_workspace_all` signature
@sonesuke sonesuke merged commit 0b1f3af into main Feb 3, 2026
5 checks passed
@sonesuke sonesuke deleted the feat/lsp-realtime-diagnostics branch February 3, 2026 13:34
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