From c477b19bdca0cc57e08f5fb93f647767ea84dd3e Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 29 Apr 2020 00:27:14 +0900 Subject: vim-patch:8.2.0084: complete item "user_data" can only be a string Problem: Complete item "user_data" can only be a string. Solution: Accept any type of variable. (closes vim/vim#5412) https://github.com/vim/vim/commit/0892832bb6c7e322fcae8560eaad5a8140ee4a06 --- runtime/doc/insert.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index fce4d8628e..e53af5074b 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1083,7 +1083,8 @@ items: empty when non-zero this match will be added even when it is an empty string user_data custom data which is associated with the item and - available in |v:completed_item| + available in |v:completed_item|; it can be any type; + defaults to an empty string All of these except "icase", "equal", "dup" and "empty" must be a string. If an item does not meet these requirements then an error message is given and -- cgit From e4a1be779b9a6bb9a47700ebf92f8dd934bb1712 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 29 Apr 2020 10:32:34 +0900 Subject: lsp/completion: Expose completion_item under completed_items.user_data. By passing through completion_item it's now possible for snippet plugins to add LSP snippet support. --- runtime/lua/vim/lsp/util.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'runtime') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index 53e2240ff5..9a51bc2557 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -240,6 +240,13 @@ function M.text_document_completion_list_to_complete_items(result, prefix) icase = 1, dup = 1, empty = 1, + user_data = { + nvim = { + lsp = { + completion_item = completion_item + } + } + }, }) end -- cgit