From: João Távora Date: Sat, 25 Aug 2018 21:57:22 +0000 (+0100) Subject: Handle case when :textdocumentsync isn't a number X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~435 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d01b5110dc6d0cf713760dbaf26ce0158478ad11;p=emacs.git 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 --- 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