fix(lsp): suppress completion request if completion is active (#30028)

Problem: the autotrigger mechanism could fire completion requests despite
completion already being active from another completion mechanism or manual
trigger

Solution: add a condition to avoid an additional request.
This commit is contained in:
glepnir 2024-08-22 15:51:44 +08:00 committed by GitHub
parent 3bd7492a69
commit e48179f31e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -403,6 +403,10 @@ local function trigger(bufnr, clients)
reset_timer()
Context:cancel_pending()
if tonumber(vim.fn.pumvisible()) == 1 and Context.isIncomplete then
return
end
local win = api.nvim_get_current_win()
local cursor_row, cursor_col = unpack(api.nvim_win_get_cursor(win)) --- @type integer, integer
local line = api.nvim_get_current_line()