Skip to content

Commit

Permalink
Improve documentation for lsp-execute-code-action (#4097)
Browse files Browse the repository at this point in the history
`lsp-execute-code-action` is a user-facing function that can be
executed e.g. when clangd says "fix available". But as it stands, the
function description is too abstract, so unless you know details
around lsp-protocol `codeAction`, you won't figure out what it's
for. Fix that by clarifying what a user can use it for.
  • Loading branch information
Hi-Angel committed Jul 12, 2023
1 parent 9bbdebf commit 39390d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lsp-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -5873,7 +5873,9 @@ It will filter by KIND if non nil."
(lsp-send-execute-command command arguments?))))))

(lsp-defun lsp-execute-code-action ((action &as &CodeAction :command? :edit?))
"Execute code action ACTION.
"Execute code action ACTION. For example, when text under the
caret has a suggestion to apply a fix from an lsp-server, calling
this function will do so.
If ACTION is not set it will be selected from `lsp-code-actions-at-point'.
Request codeAction/resolve for more info if server supports."
(interactive (list (lsp--select-action (lsp-code-actions-at-point))))
Expand Down

0 comments on commit 39390d3

Please sign in to comment.