]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/eglot.el (eglot--signal-textDocument/didOpen): Fix bug#72696
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 20 Sep 2024 18:42:22 +0000 (14:42 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 23 Sep 2024 10:45:19 +0000 (12:45 +0200)
(cherry picked from commit 29d50e245f84d62a9cf4ce00593ea4c63fc4f44d)

lisp/progmodes/eglot.el

index 221d9c0727d0df4ea8074a470541a7d074c189c8..68cf5bfd0360e95c292327bbf61b703a9f4e07ec 100644 (file)
@@ -2109,6 +2109,7 @@ Use `eglot-managed-p' to determine if current buffer is managed.")
 (defvar revert-buffer-preserve-modes)
 (defun eglot--after-revert-hook ()
   "Eglot's `after-revert-hook'."
+  ;; FIXME: Do we really need this?
   (when revert-buffer-preserve-modes (eglot--signal-textDocument/didOpen)))
 
 (defun eglot--maybe-activate-editing-mode ()
@@ -2865,6 +2866,8 @@ When called interactively, use the currently active server"
 
 (defun eglot--signal-textDocument/didOpen ()
   "Send textDocument/didOpen to server."
+  ;; Flush any potential pending change.
+  (eglot--track-changes-fetch eglot--track-changes)
   (setq eglot--recent-changes nil
         eglot--versioned-identifier 0
         eglot--TextDocumentIdentifier-cache nil)