]> git.eshelyaron.com Git - emacs.git/commitdiff
New eglot-confirm-server-initiated-edits defcustom
authorTheodor Thornhill <theo@thornhill.no>
Thu, 26 Dec 2019 08:39:33 +0000 (09:39 +0100)
committerJoão Távora <joaotavora@gmail.com>
Thu, 26 Dec 2019 08:39:33 +0000 (08:39 +0000)
* eglot.el (eglot-confirm-server-initiated-edits): New defcustom.

Copyright-paperwork-exempt: yes
Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: close https://github.com/joaotavora/eglot/issues/382

lisp/progmodes/eglot.el

index 4c0160a57050691bc82b72ada62996616eec6068..df8df13410a19e0e4a324edc6f9697630a1b013d 100644 (file)
@@ -193,6 +193,11 @@ let the buffer grow forever."
   :type '(choice (const :tag "No limit" nil)
                  (integer :tag "Number of characters")))
 
+(defcustom eglot-confirm-server-initiated-edits 'confirm
+  "Non-nil if server-initiated edits should be confirmed with user."
+  :type '(choice (const :tag "Don't show confirmation prompt" nil)
+                 (symbol :tag "Show confirmation prompt" 'confirm)))
+
 \f
 ;;; Constants
 ;;;
@@ -1547,7 +1552,7 @@ THINGS are either registrations or unregisterations (sic)."
 (cl-defmethod eglot-handle-request
   (_server (_method (eql workspace/applyEdit)) &key _label edit)
   "Handle server request workspace/applyEdit"
-  (eglot--apply-workspace-edit edit 'confirm))
+  (eglot--apply-workspace-edit edit eglot-confirm-server-initiated-edits))
 
 (defun eglot--TextDocumentIdentifier ()
   "Compute TextDocumentIdentifier object for current buffer."