hrsh7th / cmp-nvim-lsp-signature-help

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

Signature help does not respect noselect setting #42

Closed jargv closed 5 months ago

jargv commented 9 months ago

I'm using noselect in my settings and it works great for the general case, but not for Signature help. Basically I don't want <cr> to insert a completion unless I've selected an item first. But when using Signature help, it doesn't seem to work the same way, and the first overload is selected regardless of noselect.

Here's my entire nvim-cmp config:

cmp.setup({
  completeopt = 'menu,menuone,noinsert,noselect',
  snippet = {
    expand = function(args)
      require('luasnip').lsp_expand(args.body)
    end,
  },
  window = {
    completion = cmp.config.window.bordered(),
    documentation = cmp.config.window.bordered(),
  },
  mapping = cmp.mapping.preset.insert({
    ['<C-k>'] = cmp.mapping.scroll_docs(-4),
    ['<C-j>'] = cmp.mapping.scroll_docs(4),
    ['<C-n>'] = cmp.mapping.select_next_item(),
    ['<C-p>'] = cmp.mapping.select_prev_item(),
    ['<C-Space>'] = cmp.mapping.complete(),
    ['<CR>'] = cmp.mapping.confirm({ select = false }),
  }),
  sources = cmp.config.sources({
    {
      name = 'nvim_lsp',
      entry_filter = function(entry, ctx)
        return entry:get_kind() ~= cmp.lsp.CompletionItemKind.Text and entry:get_kind() ~= cmp.lsp.CompletionItemKind.Snippet
      end
    },
    { name = 'nvim_lsp_signature_help' },
    { name = 'buffer' },
    { name = 'path' },
  }, {
    { name = 'snippet', max_item_count = 0 },
  })
})
ildar-shaymukhametov commented 6 months ago

What shortcut do you use for nvim_lsp_signature_help? Does it work for all languages? I cant get it to work...

jargv commented 5 months ago

What shortcut do you use for nvim_lsp_signature_help? Does it work for all languages? I cant get it to work...

Thanks for the reply. I just reenabled signature help (it's been disabled since I reported this issue) and I couldn't repro the issue either!