]> git.eshelyaron.com Git - emacs.git/commitdiff
Reply more reasonably to server's workspace/applyedit
authorJoão Távora <joaotavora@gmail.com>
Tue, 19 Jul 2022 12:57:52 +0000 (13:57 +0100)
committerJoão Távora <joaotavora@gmail.com>
Tue, 19 Jul 2022 16:48:44 +0000 (17:48 +0100)
* eglot.el (eglot-handle-request): Return non-nil
(eglot--apply-workspace-edit): Signal jsonrpc-error, not error.

lisp/progmodes/eglot.el

index caebced5292084ca5eb829b2102e8394d19983e2..c3ef543e3dc5a80345c73eb9d950ce623fafab61 100644 (file)
@@ -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)