Skip to content
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

[CLOSED] [js code hints] Parameter hinting does not show all variants of an overloaded function. #3524

Open
core-ai-bot opened this issue Aug 29, 2021 · 7 comments

Comments

@core-ai-bot
Copy link
Member

Issue by RaymondLim
Thursday May 09, 2013 at 17:00 GMT
Originally opened as adobe/brackets#3765


  1. In a js file type $('div').height(.
  2. Press Ctrl-Space to bring up parameter hinting.

Result: You see height()->number and the other overloaded version height(number)->jQuery.fn is not shown.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday May 09, 2013 at 20:28 GMT


Seems closely related to #3684

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Thursday May 09, 2013 at 20:35 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Sunday May 12, 2013 at 05:18 GMT


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:

data(key:string, value?:?)
data(obj:Object)
data(key:string)
data()

Can we combine them all as one hint using ? and |?

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Tuesday May 14, 2013 at 18:08 GMT


@pfarland - This might be hard to implement in/with Tern, we don't know hence we would make it a Trello item.

@core-ai-bot
Copy link
Member Author

Comment by njx
Tuesday May 14, 2013 at 18:08 GMT


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?

@core-ai-bot
Copy link
Member Author

Comment by pfarland
Tuesday May 14, 2013 at 18:57 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by pfarland
Tuesday May 14, 2013 at 21:20 GMT


Moved to backlog https://trello.com/c/WwMOtJGp

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

No branches or pull requests

1 participant