blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

Ignore suggestions where the insert value is equal to the current keyword

Open chrisgrieser opened this issue 1 year ago • 2 comments

Given this example, typing "foobar" suggests "foobar" from the buffer source to me. Accepting this suggestion results in the keyword "foobar" being replaced with "foobar", effectively doing nothing.

Showcase

I would suggest to automatically filter out suggestions where the insert value is the same as the current keyword, since those are practically useless.

chrisgrieser avatar Oct 25 '24 11:10 chrisgrieser

Makes sense, although there's many cases where we would still want to show the window since accepting can do any of:

  • auto-imports (additionalTextEdits)
  • trigger commands
  • expand a snippet
  • etc..

We need to call resolve on the item to ensure that we can hide it which I plan to start calling on the completion window, instead of only on accept and documentation #195

saghen avatar Oct 25 '24 15:10 saghen

Fair point. Maybe this is simply something to only implement for the buffer source?

chrisgrieser avatar Oct 25 '24 16:10 chrisgrieser

We would need to special case this and the plugin has been getting quite complex already. It generally hasn't been an issue for many users it seems, so closing this one

saghen avatar Jan 22 '25 21:01 saghen