Login Register

Code Completion with ActiveState Komodo Editor

I like the free Komodo Edit app from ActiveState. It has it's own XML format for code completion and tips and whatnot, though the most recent Dojo version available only covers the 0.4 API ... I grew tired of using Dojo 1.0 with 0.4 API's popping up as I typed, so I ventured out to see if I could generate a CodeIntel XML (.cix) file for the new API, and it worked.

edit: i had an old version. there is a 0.9 version on the ActiveState community site

I typically don't use it, but now have basic code-completion for the entire dojo, dijit, and dojox API's at my fingertips, as I am coding. It doesn't alleviate the need to know a function name ahead of time, but can definitely be helpful in learning, and if you are at all like me, remembering the type of some expected argument, or some specific return type.

screenshots

This was a partially selfish act in that I was strictly targeting Komodo editor, as it had a published schema, and seemed simple enough to implement. If you are interested, Komodo is free. If you have the inclination, modify the makeCix.php file to generate [your favorite editor]'s data format, and share it, or assist me in doing so. I'd love to see this kind of code-assistance appear in other editors, too.

In [12021], I checked in the PHP script being used to generate the .cix (XML) file, and thoughtfully request anyone interested in improving the accuracy of the found data should not hesitate to contact me ... it doesn't handle class inheritance very well (yet), and I was kind of wrestling the data to begin with, so getting it to this point was a small feat in itself. Any PHP or XML masters out there, I could definitely use some review.

The initial dojo.cix file generated is ~815k, and is based on the API in trunk (to become 1.1). I considered breaking it into dojo.cix, dijit.cix, and dojox.cix to more fit with the project setup, but opted to maintain only one file for now ... opinions are welcome.

Though the API has not changed (much) since 1.0, I can see a desire to have a 1.0 or 1.0.2-specific version of the .cix ... The inline-docs are the source of this data (for now), so back-releasing a 1.0.x version would probably have less info available, though the API would be "more accurate" ... They would be easy to generate, but might not be worth the effort?

I hope this helps someone, and welcome any/all participation in making it better, more accurate, or more portable.

Not sure how to use it

I downloaded the latest version of Komodo Edit (your file refused to work with version 4.1 that I had), and installed it, but now nothing is happening (yes I restarted a few times).

Do I have to do something more? Change some other setting? I had a look around in the preferences, but couldn't get it working.

Thanks

Shane

here's the build I'm

here's the build I'm using:

Komodo Edit, version 4.2.1, build 283000, platform macosx-x86.
Built on Tue Nov 13 14:09:27 2007.

I just dropped it into the path where all the other .cix's live (it's some weird system path on my machine) and it worked.

There are problems with the generator not giving the required ilk="" tag to describe each element, so maybe that's where the issues are coming from?

Not out of the box

At the very least, it will not work out of the box from a new install of

Komodo Edit, version 4.2.1, build 283000, platform win32-x86.
Built on Tue Nov 13 14:27:17 2007.

without tinkering.

It looks like the location for the .cix file is .\lib\mozilla\python\komodo\codeintel2\catalogs, where there is already a dojo.cix file. In the preferences dialog under code intelligence make sure that Dojo is checked. A restart appears to be necessary.

But wait! I had been testing with a brand new .js file. If I type dojo. in that, then help appears. If I type dojo. into a preexisting Dojo JavaScript file, an error message is displayed momentarily in the status bar.

There's a little more information at http://community.activestate.com/komodo-extension/dojo-api-catalog-colle... .

This development is not ready for general consumption...

Do there can provide one

Do there can provide one color syntax highlighting for other text editor, like ultraedit, Thanks.

Promising..

This is the 1st time I've used Komodo, and I must say - I'm impressed! I've been using Aptana for quite some time now. This XUL based IDE might have changed my mind. With that said, I tinkered a bit with the Dojo API extension pack and, unfortunately, I'm unable to report any progress.

Whether using a new JS file or an existing JS file, auto-complete with the Dojo extension yields the following error in the status bar:

"could not resolve first part of 'dojo' (error determining completions)"

I'd love to know what I can do in order to help get this working. Still though, very impressed with Komodo.

Awesome.

"Could not resolve first part of 'dojo'... Any solutions?

I too am getting the "could not resolve first part of 'dojo' error. I put the .cix file in:
C:\Program Files\ActiveState Komodo Edit 4.2\lib\mozilla\python\komodo\codeintel2\catalogs

Has anyone been able to resolve this issue or have advice on troubleshooting?

Sorry - not just yet. I am

Sorry - not just yet. I am making progress however with a cleanup, and pottedmeat has made phenomenal progress with the actual API info this last weekend. When we're able to export that back to a "normal" XML file again, the "real" komodo cix will be generated from it, rather than the poor workaround I came up with. (Which works for me here, and unfortunately am unable to reproduce) ...

Please post detailed instructions when done

Thanks for the update. When it is available please post detailed instructions on how to incorporate the the fruits of your labor into Komono.

Thanks.

re: dojo api catalog

ActiveState also provide the dojo API catalogs as part of the dojo extension (version 0.4, 0.9 and 1.1):
http://community.activestate.com/komodo-extension/dojo-api-catalog-colle...

The dojo 1.1 API catalog included in this extension uses a modified version of dante's script to generate the catalog, the script modifications have been contributed back, but are are pending due to CLA restrictions:
http://trac.dojotoolkit.org/ticket/6831

Cheers,
Todd