emacs-diffs
[Top][All Lists]
Advanced

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

feature/eglot2emacs 1986c4df88 089/120: Reply more reasonably to server'


From: João Távora
Subject: feature/eglot2emacs 1986c4df88 089/120: Reply more reasonably to server's workspace/applyedit
Date: Thu, 20 Oct 2022 07:17:01 -0400 (EDT)

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

    Reply more reasonably to server's workspace/applyedit
    
    * eglot.el (eglot-handle-request): Return non-nil
    (eglot--apply-workspace-edit): Signal jsonrpc-error, not error.
---
 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 caebced529..c3ef543e3d 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -2049,6 +2049,7 @@ THINGS are either registrations or unregisterations 
(sic)."
   (_server (_method (eql workspace/applyEdit)) &key _label edit)
   "Handle server request workspace/applyEdit."
   (eglot--apply-workspace-edit edit eglot-confirm-server-initiated-edits))
+  `(:applied t))
 
 (cl-defmethod eglot-handle-request
   (server (_method (eql workspace/workspaceFolders)))
@@ -3025,7 +3026,7 @@ for which LSP on-type-formatting should be requested."
           (unless (y-or-n-p
                    (format "[eglot] Server wants to edit:\n  %s\n Proceed? "
                            (mapconcat #'identity (mapcar #'car prepared) "\n  
")))
-            (eglot--error "User cancelled server edit")))
+            (jsonrpc-error "User cancelled server edit")))
       (cl-loop for edit in prepared
                for (path edits version) = edit
                do (with-current-buffer (find-file-noselect path)



reply via email to

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