Sublime Forum

Intellisense

#1

Hi

I have just come across Sublime Text 2 but I come from an IDE environment.

I can code HTML, CSS and basic JavaScript in a text editor but I’m starting to use node.js and need to find an editor. When using jQuery in Visual Studio it provides intellisense/code completion which allows me to see what things I can do with my objects and also has notes on each function parameter.

I know a lot of people don’t like intellisense but I find it very helpful when learning a language as you don’t have to jump to documentation trying to find answers etc. Whilst I have a node.js app working I had to search high and low for information to get it running how I wanted.

So I was wondering whether there is an intellisense option for node.js and the various packages available eg/socket.io so I can understand the available functions and information for function arguments.

I already have SublimeCodeIntel installed.

Thanks

0 Likes

#2

Any comments?

0 Likes

#3

Code completion in dynamic languages is mostly a miss outside dedicated IDEs. If the language in question has an analysis server/python module a la golang (go) or rope (python) then it’s possible but in my experience it doesn’t work as well as Intellisense. You can get fairly widespread static code analysis using the ctags infrastructure but I’ve always found it to be a hassle.

For the specific case of javascript, you’re even worse off. On top of being a dynamic language everybody implements their own class model and you have to understand that in order to determine classes. At least under my understanding of type flow analysis. I have looked into trying to do something with doctorjs but while I think the system should be capable enough if you write type invariant javascript but without class types the analysis isn’t particularly useful and I didn’t take the time to understand the code and try implementing classes for a particular library. In the meantime I’ve run across ebay’s vjet, which is an eclipse plugin but haven’t looked into how well it works or how much work it’d take to pull it out of eclipse and turn into something like golang. If ctags is good enough for you, be sure to use jsctags (part of doctorjs) since exuberant’s js mode is bad.

0 Likes

#4

Thanks for the reply and I understand what you are saying however for frameworks like jQuery and node.js they have defined methods which they document.

So like Visual Studio has done there must be a way to infer types and then offer intellisense for the available object in the jQuery framework. So if you type $. the intellisense offers global methods but then when you do var arr = ]; arr. it knows arr is an array and offers the methods for arrays.

0 Likes