From d01b5110dc6d0cf713760dbaf26ce0158478ad11 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 25 Aug 2018 22:57:22 +0100 Subject: [PATCH] Handle case when :textdocumentsync isn't a number 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 75871640687..31cce816a1a 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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 -- 2.39.2