aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-08-23 03:42:27 +0800
committerGitHub <noreply@github.com>2024-08-22 21:42:27 +0200
commit1f5bcc7c4ed7a68ae4e23933aee04c50b4df8bb5 (patch)
tree49e13c9e7bbb791055fcd858482fb8cee8911560 /runtime/doc
parente48179f31e6503bfa86bf08538e64456e96446a8 (diff)
downloadrneovim-1f5bcc7c4ed7a68ae4e23933aee04c50b4df8bb5.tar.gz
rneovim-1f5bcc7c4ed7a68ae4e23933aee04c50b4df8bb5.tar.bz2
rneovim-1f5bcc7c4ed7a68ae4e23933aee04c50b4df8bb5.zip
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.
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/lsp.txt3
-rw-r--r--runtime/doc/news.txt4
2 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 32d414e9a7..05734c3ac1 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -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()*
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 7c842f42dd..1d1e87fd0b 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -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