1+ ---- --------------------------------------------------------------------
2+ -- utility function that are modified from neovim's source --
3+ ---- --------------------------------------------------------------------
4+
15local protocol = require ' vim.lsp.protocol'
26local vim = vim
37local api = vim .api
@@ -7,9 +11,6 @@ function M.is_list(thing)
711 return vim .fn .type (thing ) == api .nvim_get_vvar (" t_list" )
812end
913
10- ---- --------------------------------------------------------------------
11- -- utility function that are modified from neovim's source --
12- ---- --------------------------------------------------------------------
1314
1415---- --------------------
1516-- completion items --
@@ -51,9 +52,6 @@ function M.text_document_completion_list_to_complete_items(result, prefix)
5152 end
5253
5354 local customize_label = vim .g .completion_customize_lsp_label
54- local buf_customize_label = api .nvim_call_function (
55- ' completion#get_buffer_variable' , {' completion_buf_customize_lsp_label' })
56- if buf_customize_label == nil then buf_customize_label = {} end
5755 items = remove_unmatch_completion_items (items , prefix )
5856 -- sort_completion_items(items)
5957
@@ -86,12 +84,12 @@ function M.text_document_completion_list_to_complete_items(result, prefix)
8684 table.insert (matches , {
8785 word = word ,
8886 abbr = completion_item .label ,
89- kind = buf_customize_label [ kind ] or customize_label [kind ] or kind or ' ' ,
87+ kind = customize_label [kind ] or kind or ' ' ,
9088 menu = completion_item .detail or ' ' ,
9189 info = info ,
9290 priority = priority ,
9391 icase = 1 ,
94- user_data = vim . fn . json_encode ( user_data ) ,
92+ user_data = user_data ,
9593 dup = 1 ,
9694 empty = 1 ,
9795 })
0 commit comments