hrsh7th / cmp-nvim-lsp-signature-help

cmp-nvim-lsp-signature-help
584 stars 24 forks source link

Change `preselect` to false #32

Closed stefanmh closed 1 year ago

stefanmh commented 1 year ago

nvim-cmp allows configuring <Return> to insert a newline unless a completion has been explicitly selected, in which case it accepts the completion instead:

cmp.setup({
  mapping = cmp.mapping.preset.insert({
    ['<CR>'] = cmp.mapping.confirm({ select = false })
    ...
  })
  ...
})

This works nicely with other sources, but lsp-signature-help preselects its completion, preventing <Return> from inserting a newline.

For instance, foo.endswith(<Return> results in foo.endswith(__suffix instead of foo.endswith(<CR>.

I can't think of a good reason for preselect to be enabled.

stefanmh commented 1 year ago

Ah, I now realise the reason behind preselect=true was to automatically show the "documentation" floating window, which contains the full signature. Is there any other reasonably straightforward way to achieve this?

hrsh7th commented 1 year ago

There is currently no way to bring up the documentation window for unselected items. This plugin mimics the signature help by hacky use of the completion feature, so there are limitations.