Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 2 - is there smart intellisense with hints for jquery (not snippets!)

how can i achieve the same level of details i get when using vs2012 in my light weight sublime text 2. all the packages i tried are dealing mostly with snippets (rather than sniffing for smart hints). in vs2012 i solved it using -vsdoc. how can i solve it with sublime?

the effect i'm looking for

i'm sure there has to be a way for sublime text 2 to somehow parse the function and understand what kind of parameters i should be using in order to get my way. please don't refer me to google. i've searched everywhere.

thanks

like image 537
OrenM Avatar asked Sep 26 '12 02:09

OrenM


3 Answers

The person who wrote the forum post mentioned by @joelretdev did end up creating the JavaScript / jQuery completions package they described and it does some of what you want. It's called AndyJS2 and it is available via PackageControl. The GitHub repo for the package is https://github.com/agibsonsw/AndyJS2.

(Assuming the forum poster / package creator are the same person because the same username [agibsonsw] is used on both sites and they clearly encountered the same issue.)

like image 198
Beth Avatar answered Sep 21 '22 12:09

Beth


Unfortunately it seems that there is not a solid method of providing jQuery intellisense for SublimeText.

There is the jQuery package that you can obtain from the package manager or github: jQuery Sublime, but it only provides snippets of course this is not what you really wanted.

I did, however, find a forum post on this matter that talks about adding a sublime-completions file to this package that could provide you with some intellisense. The only problem is that you have to define all the selectors/functions/events yourself in the file.

If you're interested, here is the post that details it: SublimeText Forum

I hope this helps, if I do find anything new I'll be sure to add an addendum to my post.

like image 30
joelretdev Avatar answered Sep 19 '22 12:09

joelretdev


To my knowledge, there are not yet any good intellisense plugins for javascript in Sublime Text 2.

The snippets packages are not intellisense but simple autocompletions which do not take into account keywords, scope, or context. In order to have a true intellisense solution for javascript, your script will need to be built on the fly - probably by a node.js process - and then a syntax tree constructed.

For now, you can use the SublimeLinter package which, when used on a machine with node.js installed, will show you JSHint errors as you type. This isn't a perfect substitute, but the information provided is much more useful.

like image 32
Andy Avatar answered Sep 20 '22 12:09

Andy