You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use luasnip for snippets pretty extensively. With cmp as the completion plugin, snippets get automatically expanded. Mini.completion sees to pick up on snippets, gut only completes the snippets name. I need to manually use the luasnip expand function after that.
Additionally, mini.completion doesn't seem to be able to handle multiple matches with the same name. If i have a snippet that has the same name as a keyword or variable in my file, mini.completion always uses the LSP options. One example is "return" in a lua file. The LSP knows return as the keyword, but additionally there is a snippet available, that automatically expands this with brackets and such. In cmp i see both options, but mini.completions only shows one of those.
This is mostly a "discoverability" issue. Especially when using snippet libraries, one might not know all snippets by name. Not having an idication that a completion option refers to a snippet is a a bit sad. The "missing" autoexpand can probably be done by just writing a keymap that calls require("luasnip").expand() after inserting a completion, as that does nothing when no snippet is available. But this is also limiting, as you couldn't complete keywords that also refer to snippets without expanding them.
The text was updated successfully, but these errors were encountered:
Write now 'mini.completion' doesn't do snippet expansion. This is mostly because it is not trivial to actually expand snippet without dependencies right now.
'mini.completion' will be updated after release of 'mini.snippets' (which is planned after release of Neovim 0.10 providing snippet expansion functions). And I do indeed plan to add a way to use any snippet expansion engine.
Contributing guidelines
Module(s)
mini.completion
Description
I use luasnip for snippets pretty extensively. With cmp as the completion plugin, snippets get automatically expanded. Mini.completion sees to pick up on snippets, gut only completes the snippets name. I need to manually use the luasnip expand function after that.
Additionally, mini.completion doesn't seem to be able to handle multiple matches with the same name. If i have a snippet that has the same name as a keyword or variable in my file, mini.completion always uses the LSP options. One example is "return" in a lua file. The LSP knows return as the keyword, but additionally there is a snippet available, that automatically expands this with brackets and such. In cmp i see both options, but mini.completions only shows one of those.
This is mostly a "discoverability" issue. Especially when using snippet libraries, one might not know all snippets by name. Not having an idication that a completion option refers to a snippet is a a bit sad. The "missing" autoexpand can probably be done by just writing a keymap that calls
require("luasnip").expand()
after inserting a completion, as that does nothing when no snippet is available. But this is also limiting, as you couldn't complete keywords that also refer to snippets without expanding them.The text was updated successfully, but these errors were encountered: