emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs c17c3cfcbf 064/120: Check textdocumentsync/willsave


From: João Távora
Subject: feature/eglot2emacs c17c3cfcbf 064/120: Check textdocumentsync/willsave cap before sending it
Date: Thu, 20 Oct 2022 07:16:54 -0400 (EDT)

branch: feature/eglot2emacs
commit c17c3cfcbffc97dfae76d75ab32ec81d893be97c
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Check textdocumentsync/willsave cap before sending it
    
    * 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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index a1c5ab01eb..c32560ad8f 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]