mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
feat(lsp): completion opts support custom item conversion (#30060)
Problem: Some items of completion results include function signatures that can cause the pum to be very long when a function has many params, because pum scales with the longest word/abbr. Solution: add custom covert function that can customise abbr to remove params.
This commit is contained in:
@@ -1630,6 +1630,9 @@ Lua module: vim.lsp.completion *lsp-completion*
|
||||
Fields: ~
|
||||
• {autotrigger}? (`boolean`) Whether to trigger completion
|
||||
automatically. Default: false
|
||||
• {convert}? (`fun(item: lsp.CompletionItem): table`) An optional
|
||||
function used to customize the transformation of an
|
||||
LSP CompletionItem to |complete-items|.
|
||||
|
||||
|
||||
*vim.lsp.completion.enable()*
|
||||
|
||||
@@ -65,7 +65,9 @@ EVENTS
|
||||
|
||||
LSP
|
||||
|
||||
• TODO
|
||||
• Add convert field in |vim.lsp.completion.BufferOpts| of
|
||||
|vim.lsp.completion.enable()| an optional function used to customize the
|
||||
transformation of an Lsp CompletionItem to |complete-items|.
|
||||
|
||||
LUA
|
||||
|
||||
|
||||
Reference in New Issue
Block a user