Simple way to integrate mini.completion
and vim.snippet.expand
?
#1414
-
First of all, @echasnovski did an incredible job, and I’m using The question is: How can I (if possible) do a simple expansion of those cases using the I'm using this process_items function: require('mini.completion').setup({
window = {
info = { border = "single" },
signature = { border = "single" }
},
lsp_completion = {
process_items = function(items, base)
local res = vim.tbl_filter(
function(item)
return vim.startswith(
((item.textEdit or {}).newText or item.insertText or item.label or ''), base)
end, items)
table.sort(res, function(a, b) return (a.sortText or a.label) < (b.sortText or b.label) end)
return res
end
}
}) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Thanks for the appreciation! It means a lot!
Snippets is a big part of my text editing and I can't recommend enough to invest some time in setting them. That's why I was trying really hard to have 'mini.snippets' that is user-friendly, capable, and robust. Its development is in its final stretch, after which I hope to spend time for 'mini.completion' to finally have snippet support.
Take a look at #1277, in particular this comment for why this happens) and this comment for how to fix it). For a well behaved server this should do what you ask: not insert snippet for a not "Snippet" completion kind (just text). Does this solve the issue? |
Beta Was this translation helpful? Give feedback.
Thanks for the appreciation! It means a lot!
Snippets is a big part of my text editing and I can't recommend enough to invest some time in setting them. That's why I was trying really hard to have 'mini.snippets' that is user-friendly, capable, and robust. Its development is in its final stretch, after which I hope to spend time for 'mini.completion' to finally have snippet support.