From 62c594795af9e580eaaa663c42559ed35dc998eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sat, 25 Aug 2018 22:57:22 +0100 Subject: [PATCH] Close https://github.com/joaotavora/eglot/issues/86: 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. --- eglot.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eglot.el b/eglot.el index 7587164068..31cce816a1 100644 --- a/eglot.el +++ b/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