Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luasnip integration for mini.completion #574

Closed
2 tasks done
domsch1988 opened this issue Nov 20, 2023 · 1 comment
Closed
2 tasks done

Luasnip integration for mini.completion #574

domsch1988 opened this issue Nov 20, 2023 · 1 comment
Labels
feature-request Request for a feature to existing module mini.completion

Comments

@domsch1988
Copy link

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.

@domsch1988 domsch1988 added the feature-request Request for a feature to existing module label Nov 20, 2023
@echasnovski
Copy link
Owner

Thanks for suggestion.

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.

So I'll close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a feature to existing module mini.completion
Projects
None yet
Development

No branches or pull requests

2 participants