Skip to content

Commit

Permalink
fix: snippet resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Oct 28, 2024
1 parent 4c40bf2 commit 5d9fa1c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/blink/cmp/sources/snippets/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,11 @@ function snippets:resolve(item, callback)
local parsed_snippet = require('blink.cmp.sources.snippets.utils').safe_parse(item.insertText)
local snippet = parsed_snippet and tostring(parsed_snippet) or item.insertText

-- TODO: ideally context is passed with the filetype
local documentation = '```' .. vim.bo.filetype .. '\n' .. snippet .. '\n```' .. '\n---\n' .. item.description

local resolved_item = vim.deepcopy(item)
resolved_item.detail = snippet
resolved_item.documentation = {
kind = 'markdown',
value = documentation,
value = item.description,
}
callback(resolved_item)
end
Expand Down

0 comments on commit 5d9fa1c

Please sign in to comment.