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

Signature help stabilization

Open saghen opened this issue 11 months ago • 14 comments

Feature Description

  • Align the active argument with the argument in the text, grabbed via treesitter
  • Detect location of function to optionally avoid showing signature help in multi-line functions (#1670)
  • Support focusing the window
  • Toggle visibility of documentation + signature vs just signature (Default <C-k> to show_signature, show_signature_documentation, hide_signature)
  • Override built in vim.lsp.buf.signature_help()?
  • Show in snippet mode

saghen avatar Jan 23 '25 20:01 saghen

On 0.11,

signature = {
	enabled = true,
	trigger = {
		enabled = false,
		show_on_trigger_character = false,
		show_on_insert_on_trigger_character = false,
	},
},

still auto-shows whenever blink gets to something that has a signature. Not sure if a bug or intended behaviour right now. What I'm after is for the signature to show up exclusively when I invoke it with a keymap -- like I would for vim.lsp.buf.signature_help()

sebszyller avatar Jan 26 '25 16:01 sebszyller

Support focusing the window Override built in vim.lsp.buf.signature_help()?

These two would be particularly nice, or just an API function to manually activate the signature window. With some LSPs, this window can grow quite large so I don't want it to be always visible.

silvercircle avatar Jan 31 '25 21:01 silvercircle

You can show the window with cmp.show_signature() already fyi and it's now bound to <C-k>

saghen avatar Jan 31 '25 21:01 saghen

You can show the window with cmp.show_signature() already fyi and it's now bound to <C-k>

Oh, didn't know that. Works fine, even as a toggle with hide_signature. Thanks, that's basically all I need.

silvercircle avatar Jan 31 '25 22:01 silvercircle

You can show the window with cmp.show_signature() already fyi and it's now bound to <C-k>

Is it intended that the signature always auto-shows right now though (when enabled as in the config above)? <C-k> is cool if I want to show it, after I hide it. But there doesn't seem to be a way to keep it hidden by default, and only toggle it on with a keymap.

sebszyller avatar Jan 31 '25 22:01 sebszyller

That's not intended no, I'll look into it soon. Just been lacking time for this project recently

saghen avatar Jan 31 '25 22:01 saghen

keymap = {
	["<C-s>"] = { "show_signature", "hide_signature", "fallback" },
},
signature = {
	enabled = true,
	trigger = {
		-- enabled = false, -- if I uncomment this, the keymap won't work anymore
		show_on_trigger_character = false,
		show_on_insert_on_trigger_character = false,
	},
}

I'm not sure, but I think it was working before version 0.14.0.

strash avatar Mar 23 '25 09:03 strash

I sometimes see the signature popup appear with the first method / function argument highlighted incorrectly, usually a few characters beyond the end of the variable and the delimiting , into the next argument are also highlighted, something roughly like the below.

foo(abc: &str, def: Vec<String>)

I've so far only seen this with Rust, and have not yet seen it enough to be able to say exactly when it appears. Typically signatures work well for me in numerous languages, I think this is the only time I've noticed a problem.

Is it useful for me to report this? Shall I try to investigate further?

fin-w avatar Jul 03 '25 14:07 fin-w

do you consider make something like this as a default option? or there are some issues to execute it?

    keymap = { 
      preset = 'default',
      ['<C-y>'] = {
        function(cmp)
          cmp.select_and_accept()
          cmp.show_signature()
        end,
      },
    },

dennypenta avatar Aug 07 '25 13:08 dennypenta

Hi, how can I cycle through the overloading function with signature?

KevinNitroG avatar Aug 19 '25 00:08 KevinNitroG

Hello, I want to show the signature documention with none scrollbar and rounded border. below is my configure but it is doesn't work

signature = { enabled = true, window = { scrollbar = false, border = "rounded", }, },

jiazel-git avatar Sep 09 '25 14:09 jiazel-git

Not sure if this is related, but the keymappings (<C-b> and <C-f>) for scrolling documentation do not actually scroll documentation while the signature is shown and signature.window.show_documentation is set to true.

This happens with both scrollbar being set to true and false.

Update: Nevermind, I see b7e240484affbb62eebb8604ea3d63f88d320f12 fixes this but isn't on a release yet.

5ayam5 avatar Sep 11 '25 17:09 5ayam5

@Saghen anyway to get scroll_signature_up/down to work in select mode?

AtifChy avatar Oct 07 '25 18:10 AtifChy

Hi, how can I cycle through the overloading function with signature?

i was looking for the same thing. is this a feature yet? some of the functions i have here got like 12 overloads and i cant see them all.. and as i typed that i accidentally discovered i can scroll the window. but having the current matching overload be on top with the others would be great, or just scroll the window to the matching overload so it looks like it is with the highlight on the correct param

HenrysHouses avatar Nov 15 '25 00:11 HenrysHouses