]> git.eshelyaron.com Git - emacs.git/commitdiff
Check textdocumentsync/willsave cap before sending it
authorJoão Távora <joaotavora@gmail.com>
Mon, 4 Apr 2022 10:05:29 +0000 (11:05 +0100)
committerJoão Távora <joaotavora@gmail.com>
Mon, 4 Apr 2022 10:05:29 +0000 (11:05 +0100)
* eglot.el (eglot--guess-contact): Default language-id to educated
guess when eglot--lookup-mode returns nil.

GitHub-reference: fix https://github.com/joaotavora/eglot/issues/823

lisp/progmodes/eglot.el

index a1c5ab01eb617d7e91b3a2eb959035c87326d839..c32560ad8fbc50f487a14876f9e1b9bf2b31f7c4 100644 (file)
@@ -2277,7 +2277,8 @@ When called interactively, use the currently active server"
   "Send textDocument/willSave to server."
   (let ((server (eglot--current-server-or-lose))
         (params `(:reason 1 :textDocument ,(eglot--TextDocumentIdentifier))))
-    (jsonrpc-notify server :textDocument/willSave params)
+    (when (eglot--server-capable :textDocumentSync :willSave)
+      (jsonrpc-notify server :textDocument/willSave params))
     (when (eglot--server-capable :textDocumentSync :willSaveWaitUntil)
       (ignore-errors
         (eglot--apply-text-edits