-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
signatures: show all overloads #774
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! Maybe there should be a limit on how many signatures we show? And maybe we should be smart about which signatures we prune (i.e. prefer fewer args, but filter out any signatures with less args than currently typed)
lua/blink/cmp/lib/window/docs.lua
Outdated
if opts.detail and opts.detail ~= '' then detail_lines = docs.split_lines(opts.detail) end | ||
|
||
if opts.detail then | ||
if type(opts.detail) == 'table' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local details = type(opts.detail) == 'string' and { opts.detail } or opts.detail
details = require('blink.cmp.lib.utils').deduplicate(details)
Co-authored-by: Liam Dyer <[email protected]>
@Saghen From what I can tell the list we get already contains only the possible signatures. E.g in my example If you want I can add an option for the max amount of signatures. But I think this is already implicitly handled by |
Thanks! |
with this change the signature help should show all signatures that are possible given the current parameters.
This is useful for languages that support function overloading.
Given
it should show: