Variable: eglot-confirm-server-edits
eglot-confirm-server-edits is a customizable variable defined in
eglot.el.gz.
Value
((t . maybe-summary))
Documentation
Control if changes proposed by LSP should be confirmed with user.
If this variable's value is the symbol diff, a diff buffer pops
up, allowing the user to apply each change individually. If the
symbol summary or any other non-nil value, the user is prompted
in the minibuffer with a short summary of changes. The symbols
maybe-diff and maybe-summary mean that the confirmation is
offered to the user only if the changes target files not visited
in buffers. Finally, a nil value means all changes are applied
directly without any confirmation.
This variable's value can also be an alist ((KEY . ACTION) ...)
where KEY is either a symbol designating the invoked Emacs command
(such as eglot-rename, eglot-code-actions,
eglot-code-action-quickfix, etc.), or a list of file operation
kinds (create, rename, delete) contained in the edit.
ACTION is one of the symbols described above. The value t for
KEY is accepted and its ACTION is the default value for commands
or file operation kinds not in the alist.
This variable was added, or its default value changed, in Eglot version 1.17.30.
Aliases
eglot-confirm-server-initiated-edits (obsolete since 1.16)
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/eglot.el.gz
(defcustom eglot-confirm-server-edits '((t . maybe-summary))
"Control if changes proposed by LSP should be confirmed with user.
If this variable's value is the symbol `diff', a diff buffer pops
up, allowing the user to apply each change individually. If the
symbol `summary' or any other non-nil value, the user is prompted
in the minibuffer with a short summary of changes. The symbols
`maybe-diff' and `maybe-summary' mean that the confirmation is
offered to the user only if the changes target files not visited
in buffers. Finally, a nil value means all changes are applied
directly without any confirmation.
This variable's value can also be an alist ((KEY . ACTION) ...)
where KEY is either a symbol designating the invoked Emacs command
(such as `eglot-rename', `eglot-code-actions',
`eglot-code-action-quickfix', etc.), or a list of file operation
kinds (`create', `rename', `delete') contained in the edit.
ACTION is one of the symbols described above. The value t for
KEY is accepted and its ACTION is the default value for commands
or file operation kinds not in the alist."
:type (let ((basic-choices
'((const :tag "Use diff" diff)
(const :tag "Summarize and prompt" summary)
(const :tag "Maybe use diff" maybe-diff)
(const :tag "Maybe summarize and prompt" maybe-summary)
(const :tag "Don't confirm" nil))))
`(choice ,@basic-choices
(alist :tag "Per-command or per-kind alist"
:key-type (choice (function :tag "Command")
(repeat :tag "File operation kinds" symbol)
(const :tag "Default" t))
:value-type (choice . ,basic-choices))))
:package-version '(Eglot . "1.17.30"))