Commit be5f6e0 1 parent 40dc2e9 commit be5f6e0 Copy full SHA for be5f6e0
File tree 1 file changed +6
-5
lines changed
lua/null-ls/builtins/completion
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,17 @@ local function nvim_snippet_exists()
13
13
return status
14
14
end
15
15
16
- local function get_loaded_snippets ()
17
- return require (" snippets" ).get_loaded_snippets ( )
16
+ local function get_loaded_snippets (filetype )
17
+ return require (" snippets" ).load_snippets_for_ft ( filetype )
18
18
end
19
19
20
20
return h .make_builtin ({
21
21
name = " nvim_snippets" ,
22
22
can_run = nvim_snippet_exists ,
23
23
condition = nvim_snippet_exists ,
24
- runtime_condition = h .cache .by_bufnr (function ()
25
- return not vim .tbl_isempty (get_loaded_snippets ())
24
+ --- @param params NullLsParams
25
+ runtime_condition = h .cache .by_bufnr (function (params )
26
+ return not vim .tbl_isempty (get_loaded_snippets (params .filetype ))
26
27
end ),
27
28
meta = {
28
29
url = " https://github.com/garymjr/nvim-snippets" ,
@@ -43,7 +44,7 @@ return h.make_builtin({
43
44
end
44
45
45
46
local items = {}
46
- local snippets = get_loaded_snippets ()
47
+ local snippets = get_loaded_snippets (params . filetype )
47
48
for _ , item in pairs (snippets ) do
48
49
if vim .startswith (item .prefix , line_to_cursor :sub (start_col )) then
49
50
local insertText = (type (item .body ) == " table" ) and table.concat (item .body , " \n " ) or item .body
You can’t perform that action at this time.
0 commit comments