diff options
author | Maria José Solano <majosolano99@gmail.com> | 2024-02-26 11:42:16 -0800 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-02-27 16:50:51 +0100 |
commit | 3d96e3f9f25389e979bb7f2417ec2135f79fbfbb (patch) | |
tree | 36f95b5d70e3bff3856314c3afe05bfb5f76be0c | |
parent | 9beb40a4db5613601fc1a4b828a44e5977eca046 (diff) | |
download | rneovim-3d96e3f9f25389e979bb7f2417ec2135f79fbfbb.tar.gz rneovim-3d96e3f9f25389e979bb7f2417ec2135f79fbfbb.tar.bz2 rneovim-3d96e3f9f25389e979bb7f2417ec2135f79fbfbb.zip |
refactor(lsp): alias for CompletionResult
-rw-r--r-- | runtime/lua/vim/lsp/_completion.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/_completion.lua b/runtime/lua/vim/lsp/_completion.lua index 84dbf9083e..3a38c1b5e1 100644 --- a/runtime/lua/vim/lsp/_completion.lua +++ b/runtime/lua/vim/lsp/_completion.lua @@ -4,6 +4,8 @@ local lsp = vim.lsp local protocol = lsp.protocol local ms = protocol.Methods +--- @alias vim.lsp.CompletionResult lsp.CompletionList | lsp.CompletionItem[] + ---@param input string unparsed snippet ---@return string parsed snippet local function parse_snippet(input) @@ -37,7 +39,7 @@ local function get_completion_word(item) return item.label end ----@param result lsp.CompletionList|lsp.CompletionItem[] +---@param result vim.lsp.CompletionResult ---@return lsp.CompletionItem[] local function get_items(result) if result.items then @@ -49,7 +51,7 @@ end --- Turns the result of a `textDocument/completion` request into vim-compatible --- |complete-items|. --- ----@param result lsp.CompletionList|lsp.CompletionItem[] Result of `textDocument/completion` +---@param result vim.lsp.CompletionResult Result of `textDocument/completion` ---@param prefix string prefix to filter the completion items ---@return table[] ---@see complete-items @@ -130,7 +132,7 @@ end ---@param lnum integer 0-indexed line number ---@param client_start_boundary integer 0-indexed word boundary ---@param server_start_boundary? integer 0-indexed word boundary, based on textEdit.range.start.character ----@param result lsp.CompletionList|lsp.CompletionItem[] +---@param result vim.lsp.CompletionResult ---@param encoding string ---@return table[] matches ---@return integer? server_start_boundary |