-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[js code hints] Parameter hinting does not show all variants of an overloaded function. #3765
Comments
Seems closely related to #3684 |
Yes, it's related. But this one is to help users with parameters of a specific overloaded function and #3684 has to do with chaining. |
A solution for #3684 may or may not fix this issue. To fix this issue we may have to consider showing multiple hints (one for each variant) instead of just showing one with "?" as we currently have. Consider for $().data that has the following four variants:
Can we combine them all as one hint using |
@pfarland - This might be hard to implement in/with Tern, we don't know hence we would make it a Trello item. |
I wonder if Tern has a notion of disjunctive type--e.g. if it sees that a single variable is used as a number in one place and a string in another, does it just generalize it to Object, or can it hold onto both types as possibilities? |
Tern does seem to track multiple types when looking at assignments and shows proposals from the APIs of those types, however, the built-ins/defs syntax requires an enhancement in Tern to support different signatures. This may need to be extended to consider function API hints from source information too. |
Moved to backlog https://trello.com/c/WwMOtJGp |
$('div').height(
.Result: You see height()->number and the other overloaded version height(number)->jQuery.fn is not shown.
The text was updated successfully, but these errors were encountered: