1

I've tried some of the editors/IDEs regularly recommended for coding JavaScript (Aptana, WebStorm, ...) but none of them has a satisfying autocomplete functionality. I'm probably spoiled by Microsoft's IntelliSense for .NET. There is some JavaScript-IntelliSense in WebDeveloper, but that seems to be a stripped-down version. The best I've found so far is WebStorm, but its code completition is easily distracted by imported libraries (offering hundreds of suggestions) and identical function names.

Did I miss an editor/IDE that uses refactoring (or something else) to offer proper code completition, so that it really "knowns" what that variable-name stands for, I just put a dot behind? Or is something like this on its way?

duffymo
  • 305,152
  • 44
  • 369
  • 561
user414873
  • 741
  • 8
  • 20
  • 1
    Note that this will never be *fully* possible, in every dynamic language. Of course it *is* possible to some degree, but it seems to be pretty hard. –  Nov 06 '10 at 12:57
  • What's wrong with JavaScript IntelliSense in Visual Studio ? VS2008 was already aware of the actual types of stuff quite often (and presented string methods when it was sure your object was a string), and VS2010 actually executes a lot of code internally to find out object types and dynamically added members. But as @delnan said, it is simply not possible to offer "complete" code completion for a dynamic language, the way VS can do it for .NET (and even that is now "incomplete" with the addition of `dynamic` in .NET 4). – TeaDrivenDev Nov 06 '10 at 13:15

2 Answers2

2

I always recommend Komodo Edit from ActiveState (now up to version 6, with support for HTML 5 and CSS3 as well as recent versions of Javascript, PHP, etc.) Note that you may have to install addons for the languages you're working in, but you should find them through the Mozilla-like Addon manager.

Also supports jQuery and even lets you use jQuery (along with vanilla Javascript or Python) in its powerful macro IDE.

Code completion example:

<script type="application/x-javascript">
    var obj = {};
    obj.personnel = [{firstName:"John", lastName:"Brick", age:43},
                     {firstName:"Jane", lastName:"Motte", age:26}
                    ];
    // now type obj. and code completion immediately offers you "personnel"
    // note: file must be saved for the app to find all members of declared
    // variables, but I save about every 10 seconds so it's not a problem
</script>
Robusto
  • 31,447
  • 8
  • 56
  • 77
0

The best I've found so far is WebStorm, but its code completition is easily distracted by imported libraries (offering hundreds of suggestions) and identical function names.

This comment confuses me. If you import the libraries, and your code is using them, why is it bad to include the function names in the code completion suggestions? Wouldn't you want to have jQuery's functions included if you're using it?

If you're using Microsoft's IntelliSense with jQuery, does it stick to its guns and only show JavaScript core functions? Sounds limited to me, unable to be smart when I add libraries.

Or is something like this on it's [sic] way?

It sounds to me like you want a clairvoyant interface. I don't think it is on the way anytime soon.

By the way, "it's" == "it is"; "its" is the possessive.

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • out of context suggestions can sometimes do more harm than they help. I especially hate the way XCode does it, or at least how it looks like to me: just parse the file, consider all tokens as possible completions. VS tries to execute your script and gives suggestions based on runtime values. I would love to see a VS for Mac. – orcun Apr 18 '11 at 13:52