This repository was archived by the owner on Oct 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 1313local function get_completion_word (item , prefix )
1414 if item .textEdit ~= nil and item .textEdit ~= vim .NIL
1515 and item .textEdit .newText ~= nil and (item .insertTextFormat ~= 2 or vim .fn .exists (' g:loaded_vsnip_integ' )) then
16- local start_range = item .textEdit .range [" start" ]
17- local end_range = item .textEdit .range [" end" ]
18- if start_range .line == end_range .line and start_range .character == end_range .character then
19- return prefix .. item .textEdit .newText
16+ local start_range = item .textEdit .range [" start" ]
17+ local end_range = item .textEdit .range [" end" ]
18+ local newText
19+ if start_range .line == end_range .line and start_range .character == end_range .character then
20+ newText = prefix .. item .textEdit .newText
21+ else
22+ newText = item .textEdit .newText
23+ end
24+ if protocol .InsertTextFormat [item .insertTextFormat ] == " PlainText" then
25+ return newText
2026 else
21- return item . textEdit . newText
27+ return vim . lsp . util . parse_snippet ( newText )
2228 end
2329 elseif item .insertText ~= nil and item .insertText ~= vim .NIL then
2430 if protocol .InsertTextFormat [item .insertTextFormat ] == " PlainText" then
You can’t perform that action at this time.
0 commit comments