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

Incorrect function return type for jQuery setter functions #12275

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

Incorrect function return type for jQuery setter functions #12275

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

Comments

@core-ai-bot
Copy link
Member

Issue by RaymondLim
Wednesday May 01, 2013 at 00:01 GMT
Originally opened as adobe/brackets#3684


jQuery has overloaded functions; both setters and getters have the same name, but setters have some extra parameters and most of them return jQuery object for chaining.

  1. In a js file type $("div").css("display", "none").
  2. Type a dot to chain the call with other jQuery api.

Result: You get hints for string methods instead of jQuery methods.

@core-ai-bot
Copy link
Member Author

Comment by njx
Friday May 03, 2013 at 20:54 GMT


Reviewed. Marking medium priority to@eztierney for sprint 25 since it seems like a common case.

@core-ai-bot
Copy link
Member Author

Comment by eztierney
Thursday May 09, 2013 at 15:22 GMT


I looked through the jQuery docs, and I found 3 methods like this:
attr
css
prop

I didn't see any other methods which looked like they were overloaded like this, but I may have missed some.

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Thursday May 09, 2013 at 15:40 GMT


three more -- height, width and html.

@core-ai-bot
Copy link
Member Author

Comment by njx
Thursday May 09, 2013 at 17:52 GMT


A few more: offset(), text(), scrollLeft(), scrollTop(), .val(). (I found these by searching for "or set" on http://api.jquery.com/. There might be others, but these seem like the most common.)

@core-ai-bot
Copy link
Member Author

Comment by pfarland
Friday May 10, 2013 at 19:44 GMT


Erik logged a Tern bug, see the comments in ternjs/tern#123.

@core-ai-bot
Copy link
Member Author

Comment by pfarland
Tuesday May 14, 2013 at 17:25 GMT


Removing Sprint 25 milestone as we're dependent on a fix in Tern

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Mar 17, 2014 at 21:30 GMT


Was assigned to tern team, so marking "Needs Review".

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