-
Notifications
You must be signed in to change notification settings - Fork 201
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
eglot should flush recent changes before didSave notification #60
Comments
Despite the fact that the program is correct, this leads to diagnostics such as:
|
By the way, when you can, make a PR to add this to the
Don't you mean before each diff --git a/eglot.el b/eglot.el
index c3a0d51..afe6911 100644
--- a/eglot.el
+++ b/eglot.el
@@ -1116,6 +1116,7 @@ When called interactively, use the currently active server"
(defun eglot--signal-textDocument/didSave ()
"Send textDocument/didSave to server."
+ (eglot--signal-textDocument/didChange)
(jsonrpc-notify
(eglot--current-server-or-lose)
:textDocument/didSave |
I'll try, although this server has a lot of configurable parameters. I think at least two
I meant before every notification just to be safe but perhaps that's too much. I'm not sure if other notifications depend on |
…e notification * eglot.el (eglot--signal-textDocument/didSave): Call eglot--signal-textDocument/didChange.
…e notification * eglot.el (eglot--signal-textDocument/didSave): Call eglot--signal-textDocument/didChange.
* eglot.el (eglot--signal-textDocument/didSave): Call eglot--signal-textDocument/didChange. #60: joaotavora/eglot#60
* eglot.el (eglot--signal-textDocument/didSave): Call eglot--signal-textDocument/didChange. GitHub-reference: close joaotavora/eglot#60
When I make a change in the buffer, and then immediately save it,
didChange
events are ran afterdidSave
notifications. This leads to eglot and some servers having different document versions. This happens to me witheclipse.jdt.ls
LSP server. Other servers that I tested simply ignoreTextDocument/didSave
notifications so it will never happen. Here is an example witheclipse.jdt.ls
:M-x kill-whole-line
C-x C-s
(before recent changes are sent)One solution to it is to ensure recent changes are flushed before every notification.
The text was updated successfully, but these errors were encountered: