(eval-and-compile
(defvar eglot--lsp-interface-alist
`(
- (CodeAction (:title) (:kind :diagnostics :edit :command :isPreferred))
+ (CodeAction (:title) (:kind :diagnostics :edit :command :isPreferred :data))
(ConfigurationItem () (:scopeUri :section))
(Command ((:title . string) (:command . string)) (:arguments))
(CompletionItem (:label)
(server action) "Default implementation."
(eglot--dcase action
(((Command)) (eglot--request server :workspace/executeCommand action))
- (((CodeAction) edit command)
- (when edit (eglot--apply-workspace-edit edit))
- (when command (eglot--request server :workspace/executeCommand command))))))
+ (((CodeAction) edit command data)
+ (if (and (null edit) (null command) data
+ (eglot--server-capable :codeActionProvider :resolveProvider))
+ (eglot-execute server (eglot--request server :codeAction/resolve action))
+ (when edit (eglot--apply-workspace-edit edit))
+ (when command (eglot--request server :workspace/executeCommand command)))))))
(cl-defgeneric eglot-initialization-options (server)
"JSON object to send under `initializationOptions'."
:documentHighlight `(:dynamicRegistration :json-false)
:codeAction (list
:dynamicRegistration :json-false
+ :resolveSupport t :dataSupport t
:codeActionLiteralSupport
'(:codeActionKind
(:valueSet