mirror of
https://github.com/neovim/neovim.git
synced 2026-10-25 23:20:23 -05:00
perf(lsp): avoid textDocument/definition requests during tag completion (#37260)
Problem: vim.lsp.tagfunc looks for the presence of 'c' (cursor) flag and issues sync textDocument/definition requests to all clients, otherwise workspace/symbol requests. But 'c' flag can also be set during the insert mode completion, e.g. with an empty tag completion query, the tag func receives pattern of '\<\k\k' with flags 'cir'. Solution: check for 'i' (insert mode completion) flag and don't issue any LSP requests, return vim.NIL for immediate fallback to tags.
This commit is contained in:
1 parent
94144d4678
commit
1629493f72
2 files changed
+12
No files matched your search
@@ -5680,6 +5680,14 @@ describe('LSP', function()
|
||||
},
|
||||
}, result)
|
||||
end)
|
||||
|
||||
it('with flags including i, returns NIL', function()
|
||||
exec_lua(function()
|
||||
local result = vim.lsp.tagfunc('foobar', 'cir')
|
||||
assert(result == vim.NIL, 'should not issue LSP requests')
|
||||
return {}
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('cmd', function()
|
||||
|
||||
Reference in new issue
Block a user