]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle case when :textdocumentsync isn't a number
authorJoão Távora <joaotavora@gmail.com>
Sat, 25 Aug 2018 21:57:22 +0000 (22:57 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sat, 25 Aug 2018 21:57:22 +0000 (22:57 +0100)
Also closes https://github.com/joaotavora/eglot/issues/87.

* eglot.el (eglot--signal-textDocument/didChange): Grab :change
from :textDocumentSync server capability.

GitHub-reference: close https://github.com/joaotavora/eglot/issues/86

lisp/progmodes/eglot.el

index 758716406877c1f51a696b96086b9fbe3a92a6a0..31cce816a1a40cc7be563923f043e94e19b43543 100644 (file)
@@ -1191,7 +1191,9 @@ When called interactively, use the currently active server"
   "Send textDocument/didChange to server."
   (when eglot--recent-changes
     (let* ((server (eglot--current-server-or-lose))
-           (sync-kind (eglot--server-capable :textDocumentSync))
+           (sync-capability (eglot--server-capable :textDocumentSync))
+           (sync-kind (if (numberp sync-capability) sync-capability
+                        (plist-get sync-capability :change)))
            (full-sync-p (or (eq sync-kind 1)
                             (eq :emacs-messup eglot--recent-changes))))
       (jsonrpc-notify