Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4501: Auto adjust stale diagnostic ranges on document changes #4513

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

necto
Copy link
Contributor

@necto necto commented Jul 28, 2024

To keep the diagnostic ranges actual after document edits and before LSP sends an update (can take multiple seconds or even minutes for SonarLint C++ analysis), allocate an overlay for each diagnostic and use it as the reference for its range.
This change works well together with #4512, which spares the LSP server from playing catch-up with the user modifications.

lsp-diagnostics and lsp--get-buffer-diagnostics now have an additional optional argument: update-ranges? that refreshes the diagnostic ranges.

This fixes #4501.

@necto
Copy link
Contributor Author

necto commented Jul 28, 2024

It is also compatible with the experimental support for code snippets inside org-mode documents, see
lsp-mock-server-org-flycheck-updates-diags-with-delay

@jcs090218
Copy link
Member

Can you resolve conflicts? Thank you!

@necto
Copy link
Contributor Author

necto commented Aug 2, 2024

Can you resolve conflicts? Thank you!

done

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

Successfully merging this pull request may close these issues.

Auto-adjust diagnostic ranges on document modification while waiting for update from LSP server
2 participants