Skip to content
This repository has been archived by the owner on Jul 21, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Nov 29, 2023
1 parent 923c67b commit 6e6f7fd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions lua/epo/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -242,23 +242,17 @@ local function complete_ondone(bufnr)
offset_snip = cp_item.insertText
end

if cp_item.additionalTextEdits then
lsp.util.apply_text_edits(cp_item.additionalTextEdits, bufnr, client.offset_encoding)
end

if offset_snip then
offset_snip = offset_snip:sub(col - context[args.buf].startidx + 1)
if #offset_snip > 0 then
vim.snippet.expand(offset_snip)
end
end

if cp_item.additionalTextEdits then
for _, edit in ipairs(cp_item.additionalTextEdits) do
local range = edit.range
if range.start.line == range['end'].line then
range['end'].line = range['end'].line + 1
end
end
lsp.util.apply_text_edits(cp_item.additionalTextEdits, bufnr, client.offset_encoding)
end

if signature then
local clients =
vim.lsp.get_clients({ bufnr = args.buf, method = ms.textDocument_signatureHelp })
Expand Down

0 comments on commit 6e6f7fd

Please sign in to comment.