From 7ef5e363d360f86c5d8d403e90ed256f4de798ec Mon Sep 17 00:00:00 2001 From: kishii <24446852+zhoudaxia2016@users.noreply.github.com> Date: Sat, 21 Jan 2023 15:22:34 +0800 Subject: feat(lsp): add triggerKind option for vim.lsp.buf.code_action (#21905) --- runtime/lua/vim/lsp/protocol.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'runtime/lua/vim/lsp/protocol.lua') diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua index 92cda0b34f..12345b6c8c 100644 --- a/runtime/lua/vim/lsp/protocol.lua +++ b/runtime/lua/vim/lsp/protocol.lua @@ -304,6 +304,17 @@ local constants = { -- Base kind for an organize imports source action SourceOrganizeImports = 'source.organizeImports', }, + -- The reason why code actions were requested. + ---@enum lsp.CodeActionTriggerKind + CodeActionTriggerKind = { + -- Code actions were explicitly requested by the user or by an extension. + Invoked = 1, + -- Code actions were requested automatically. + -- + -- This typically happens when current selection in a file changes, but can + -- also be triggered when file content changes. + Automatic = 2, + }, } for k, v in pairs(constants) do -- cgit