File tree 2 files changed +5
-2
lines changed
lua/blink/cmp/sources/snippets
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,11 @@ function snippets:get_completions(_, callback)
44
44
end
45
45
46
46
function snippets :resolve (item , callback )
47
+ local parsed_snippet = require (' blink.cmp.sources.snippets.utils' ).safe_parse (item .insertText )
48
+ local snippet = parsed_snippet and tostring (parsed_snippet ) or item .insertText
49
+
47
50
-- TODO: ideally context is passed with the filetype
48
- local documentation = ' ```' .. vim .bo .filetype .. ' \n ' .. item . insertText .. ' ```' .. ' \n ---\n ' .. item .description
51
+ local documentation = ' ```' .. vim .bo .filetype .. ' \n ' .. snippet .. ' ```' .. ' \n ---\n ' .. item .description
49
52
50
53
local resolved_item = vim .deepcopy (item )
51
54
resolved_item .documentation = {
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ function registry:snippet_to_completion_item(snippet)
110
110
kind = require (' blink.cmp.types' ).CompletionItemKind .Snippet ,
111
111
label = snippet .prefix ,
112
112
insertTextFormat = vim .lsp .protocol .InsertTextFormat .Snippet ,
113
- insertText = self :parse_body (body ),
113
+ insertText = self :expand_vars (body ),
114
114
description = snippet .description ,
115
115
}
116
116
end
You can’t perform that action at this time.
0 commit comments