Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
necto wants to merge18 commits intoemacs-lsp:master
base:master
Choose a base branch
Loading
fromnecto:az/fix-transient-ranges

Conversation

@necto
Copy link
Contributor

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.

Thisfixes#4501.

@necto
Copy link
ContributorAuthor

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
ContributorAuthor

Can you resolve conflicts? Thank you!

done

@msrd0
Copy link

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 checkedlsp-diagnostic-clean-after-change is set tonil. Am I doing something wrong?

@necto
Copy link
ContributorAuthor

Hi@msrd0
How can I reproduce this behavior?

@msrd0
Copy link

@necto my emacs config is here:https://gitlab.com/msrd0/dotfiles/-/blob/master/HOME/.emacs.d/init.el?ref_type=heads#L63

Here's a video of the problem:

2025_02_26_1517.webm

As you can see, after I made sure there's an error in the file, everytime I save the error appears, and after I add a newline, the error disappears a short time after I made that edit, and only reappears when I save (emacs tells you at the bottom of the screen when it saves the file).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

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

3 participants

@necto@jcs090218@msrd0

[8]ページ先頭

©2009-2025 Movatter.jp