There are a few changes in this PR (let me know if you want me to split them up), all related to improving the cmp source.
Use the body for insertText instead of prefix, to allow showing a preview as ghost text instead of just showing the prefix.
Use the InsertTextFormat.snippet to invoke cmp's snippet expansion instead of using vim.snippet directly (users will have configured cmp to expand via vim.snippet).
Adds markdown code block surrounding the preview body to allow treesitter highlighting of code previews (can be disabled via an option)
There are a few changes in this PR (let me know if you want me to split them up), all related to improving the cmp source.
insertText
instead ofprefix
, to allow showing a preview as ghost text instead of just showing the prefix.InsertTextFormat.snippet
to invokecmp
's snippet expansion instead of usingvim.snippet
directly (users will have configured cmp to expand via vim.snippet).