@@ -4,7 +4,7 @@ local match = require'completion.matching'
4
4
local M = {}
5
5
6
6
7
- local getUltisnipItems = function (prefix )
7
+ M . getUltisnipItems = function (prefix )
8
8
if vim .fn .exists (" *UltiSnips#SnippetsInCurrentScope" ) == 0 then return {} end
9
9
local snippetsList = api .nvim_call_function (' UltiSnips#SnippetsInCurrentScope' , {})
10
10
local complete_items = {}
@@ -28,7 +28,7 @@ local getUltisnipItems = function(prefix)
28
28
return complete_items
29
29
end
30
30
31
- local getNeosnippetItems = function (prefix )
31
+ M . getNeosnippetItems = function (prefix )
32
32
if vim .fn .exists (" *neosnippet#helpers#get_completion_snippets" ) == 0 then return {} end
33
33
local snippetsList = api .nvim_call_function (' neosnippet#helpers#get_completion_snippets' , {})
34
34
local complete_items = {}
@@ -51,7 +51,7 @@ local getNeosnippetItems = function(prefix)
51
51
return complete_items
52
52
end
53
53
54
- local getVsnipItems = function (prefix )
54
+ M . getVsnipItems = function (prefix )
55
55
if vim .fn .exists (' g:loaded_vsnip' ) == 0 then return {} end
56
56
local snippetsList = api .nvim_call_function (' vsnip#source#find' , {api .nvim_buf_get_option (0 , ' filetype' )})
57
57
local complete_items = {}
@@ -76,15 +76,15 @@ local getVsnipItems = function(prefix)
76
76
return complete_items
77
77
end
78
78
79
- M .getCompletionItems = function (prefix , score_func , _ )
79
+ M .getCompletionItems = function (prefix )
80
80
local source = vim .g .completion_enable_snippet
81
81
local snippet_list = {}
82
82
if source == ' UltiSnips' then
83
- snippet_list = getUltisnipItems (prefix , score_func )
83
+ snippet_list = M . getUltisnipItems (prefix )
84
84
elseif source == ' Neosnippet' then
85
- snippet_list = getNeosnippetItems (prefix , score_func )
85
+ snippet_list = M . getNeosnippetItems (prefix )
86
86
elseif source == ' vim-vsnip' then
87
- snippet_list = getVsnipItems (prefix , score_func )
87
+ snippet_list = M . getVsnipItems (prefix )
88
88
end
89
89
return snippet_list
90
90
end
0 commit comments