Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can or how to trigger signature help? #2656

Closed
cr0wt opened this issue Nov 25, 2020 · 9 comments
Closed

Can or how to trigger signature help? #2656

cr0wt opened this issue Nov 25, 2020 · 9 comments

Comments

@cr0wt
Copy link

cr0wt commented Nov 25, 2020

Is your feature request related to a problem? Please describe.
I'm trying to set up signature help to be triggered just as it is possible with completion (ig by <Tab> or <c-space>).

Describe the solution you'd like
Documentation for signature has:

"signature.enable":~

	Enable signature help when trigger character typed, require restart
	service on change.,  default: `true`

And for completion:

"suggest.autoTrigger":~

	How should completion be triggered,  default: `"always"`

	Valid options: ["always","trigger","none"]

That "trigger" option and function/setting similiar to inoremap <silent><expr> <c-space> coc#refresh() for signature help is what I'm looking for.

Additional context
I'm aware of signature.triggerSignatureWait.

@chemzqm
Copy link
Member

chemzqm commented Nov 25, 2020

coc#refresh is for completion, there is an action for trigger signature help.

@chemzqm chemzqm closed this as completed Nov 25, 2020
@yueyingjuesha
Copy link

@chemzqm, I tried to trigger the signature help using :call CocAction('showSignatureHelp'), or try to assign this command a map, no signature text display, however when I use autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp'), and in select mode when entering function parameter, it will trigger the signature help, quite don't understand here

@chemzqm
Copy link
Member

chemzqm commented May 21, 2021

Your language server could be slow to response.

@yueyingjuesha
Copy link

I think it isn't the timeout fault, when I use autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') , the signature is returned instantly, I already bumped the signature.triggerSignatureWait to maximum 1000, but still not working when directly invoking command :call CocActionAsync('showSignatureHelp')

@yueyingjuesha
Copy link

yueyingjuesha commented May 21, 2021

Basically, I want a keymap that can trigger function signature help, not automatically triggered when entering function parameter(CocJumpPlaceholder)), do you know is there a workable solution to this? @chemzqm

@chemzqm
Copy link
Member

chemzqm commented May 21, 2021

CocActionAsync('showSignatureHelp') should work, make sure call it in insert mode instead of command line, your language server may return nothing, you can debug it https://github.com/neoclide/coc.nvim/wiki/Debug-coc.nvim

@yaegassy
Copy link
Contributor

@yueyingjuesha Do you want to map "signature help" in insert mode?

e.g:

inoremap <silent> ,s <C-r>=CocActionAsync('showSignatureHelp')<CR>

@yueyingjuesha
Copy link

That's pretty nice, it works!

@jzes
Copy link

jzes commented Jun 5, 2024

Awesome

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants