-
-
Notifications
You must be signed in to change notification settings - Fork 905
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
base: master
Are you sure you want to change the base?
Conversation
This map keeps track of overlays guarding the diagnostic ranges
Nonetheless it actually works on CI at the moment: https://github.com/emacs-lsp/lsp-mode/actions/runs/10130730283/job/28012482598?pr=4513
It is also compatible with the experimental support for code snippets inside org-mode documents, see |
Can you resolve conflicts? Thank you! |
done |
I tried this PR and when I add/remove a line (regardless of whether that line is in front of or behind the diagnostic) the diagnostics move for a split second but then completely disappear. I've checked |
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
andlsp--get-buffer-diagnostics
now have an additional optional argument:update-ranges?
that refreshes the diagnostic ranges.This fixes #4501.