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

[mini.completion] extra garbage in completed function #1277

Closed
3 tasks done
ngortheone opened this issue Oct 14, 2024 · 2 comments
Closed
3 tasks done

[mini.completion] extra garbage in completed function #1277

ngortheone opened this issue Oct 14, 2024 · 2 comments

Comments

@ngortheone
Copy link

ngortheone commented Oct 14, 2024

Contributing guidelines

Module(s)

mini.completion

Description

Hi @echasnovski !

I recently switched from hrsh7th/nvim-cmp to mini.completion. Everything seems to work great out of the box except for one thing. When completing functions with LSP (I use golang, but I think it is true for all LSPs) the completed function appears with some garbage where parameters should be.

Example: I complete Logger.Info function which takes some parameters.
The completed line looks like this

Logger.Info(${1:})

This ${1:} is the garbage. I didn't find a way to disable it. Please help.

Neovim version

v0.11.0-dev-957+g0e42c81c7f

Steps to reproduce

  1. Setup any LSP (gopls in my case)
  2. Open any codebase
  3. Start typing a funcion name, complete a function name.
  4. Observe garbage where function parameters should be!

Expected behavior

Function's parameter list should be empty

Actual behavior

Garbage ${1:} appears

@ngortheone ngortheone added the bug Something isn't working label Oct 14, 2024
@GitMurf
Copy link

GitMurf commented Oct 14, 2024

@ngortheone these are for snippet placeholders from the lsp which mini.completion does not support yet.

See here for same issue on TypeScript and Lua and how to fixed it (assume similar setting for Go LSP but I have no Go experience):

The key is to try and find something in the Go LSP config/settings similar to this: Lua.completion.callSnippet = 'Replace'

See here for conversation on future mini.snippets being a module (WIP but nothing available yet): #886 (comment)

@echasnovski echasnovski added mini.completion and removed bug Something isn't working labels Oct 14, 2024
@echasnovski
Copy link
Owner

Thanks for the issue!

Indeed, as @GitMurf said, this comes from LSP server advertising completion item as not 'Snippet' kind but instead completing as if it was a snippet.

I was also told somewhere (can not find this, unfortunately), that this can be controlled via textDocument.completion.completionItem.snippetSupport server capability. I.e. setting this to false in your LSP setup (at least until there is snippet support in 'mini.completion') should fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants