diff options
author | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2025-03-16 13:58:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-16 13:58:38 +0100 |
commit | 3e3775961fd231ab7cf1e8c67bb28249f720333c (patch) | |
tree | d2220893408b500c0a282bf61f432fd841103e9b /runtime/lua/vim | |
parent | f5dd30948e67b0bfbfe0f1023a9b0c8a0b20b486 (diff) | |
download | rneovim-3e3775961fd231ab7cf1e8c67bb28249f720333c.tar.gz rneovim-3e3775961fd231ab7cf1e8c67bb28249f720333c.tar.bz2 rneovim-3e3775961fd231ab7cf1e8c67bb28249f720333c.zip |
refactor(lsp)!: rename lsp.completion.trigger() to get() (#32911)
Problem: `trigger` is a custom word not yet used in APIs.
Solution: Use `get` instead because the main effect is that the
completion candidates will be collected (and shown by default,
but follow-up commits are planned to add an `on_result` callback
that allows more general handling).
---------
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r-- | runtime/lua/vim/lsp/completion.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/lua/vim/lsp/completion.lua b/runtime/lua/vim/lsp/completion.lua index 4064e02597..dcb7b5fa9b 100644 --- a/runtime/lua/vim/lsp/completion.lua +++ b/runtime/lua/vim/lsp/completion.lua @@ -536,7 +536,7 @@ local function on_insert_char_pre(handle) local ctx = { triggerKind = protocol.CompletionTriggerKind.TriggerForIncompleteCompletions } if debounce_ms == 0 then vim.schedule(function() - M.trigger({ ctx = ctx }) + M.get({ ctx = ctx }) end) else completion_timer = new_timer() @@ -544,7 +544,7 @@ local function on_insert_char_pre(handle) debounce_ms, 0, vim.schedule_wrap(function() - M.trigger({ ctx = ctx }) + M.get({ ctx = ctx }) end) ) end @@ -791,13 +791,13 @@ function M.enable(enable, client_id, bufnr, opts) end --- @inlinedoc ---- @class vim.lsp.completion.trigger.Opts +--- @class vim.lsp.completion.get.Opts --- @field ctx? lsp.CompletionContext Completion context. Defaults to a trigger kind of `invoked`. --- Triggers LSP completion once in the current buffer. --- ---- @param opts? vim.lsp.completion.trigger.Opts -function M.trigger(opts) +--- @param opts? vim.lsp.completion.get.Opts +function M.get(opts) opts = opts or {} local ctx = opts.ctx or { triggerKind = protocol.CompletionTriggerKind.Invoked } local bufnr = api.nvim_get_current_buf() |