Monday, December 18, 2006

aptana code assist and telerik

Late last week I discovered an incredible new (free) application for working with JavaScript called Aptana (see my introduction). One of the most useful features of the new IDE is its support for JavaScript "Code Assist" - Intellisense for client-side programming. Using Aptana, you can create "Code Assist Profiles" by adding JavaScript files to special Code Assist Profile folders. Once the files are in a Code Assist folder and you make that folder the active Profile, you get full "Code Assist" support as you write your JavaScript code.

Telerik has huge client-side APIs built-in to the r.a.d.controls and I decided to see what would happen if I setup a Code Assist Profile for one of the r.a.d.controls. To do this yourself, you'll need the r.a.d.control source code (available to all subscription developers) and the uncompressed, unobfuscated JavaScript files for each r.a.d.control. Once you've got the source, setting up the Profile is very easy.

Start by creating a Code Assist Profile for your telerik control(s) and add the JavaScript desired files (Fig 1).

Fig 1: Code Assist Profiles can be configured with r.a.d.control JavaScript files

Once your Profile is setup, create a new JavaScript file to test the r.a.d.control Code Assist. Just to test the Code Assist view, I created a new RadAjaxManager object in a dummy JavaScript function and then tried to access it's members. Like magic, the Code Assist window popped-up and revealed all of the available Functions (shown as a green circle with an F) and Properties (small green circle) for the RadAjaxManager JavaScript class! (Fig 2) Fig 2: Aptana "Code Sense" with r.a.d.ajax JavaScript While conducting this test, I found a few issues with this early beta version of Aptana that will likely make it less appealing to ASP.NET developers. Aptana is great at handling HTML, CSS, and JavaScript, but when you open an ASPX file in Aptana and try to edit JavaScript you get no syntax highlighting or Code Assist support. That means Aptana will not be your tool of choice for editing JavaScript embedded in your ASPX files- at least not directly.

There is another tool, though, that may make Aptana worth downloading even if you don't use if for coding. The Outline tool provides full document outlines for both HTML, CSS, and JavaScript documents. When used with telerik JavaScript files, the Outline view becomes a handy class explorer for digging around and understanding the r.a.d.control client-side APIs. (Fig 3) Fig 3: Browse JavaScript files using Aptana Outline tool

The integration that Orcas will likely bring to JavaScript Intellisense and ASP.NET programming will probably make it the better tool for .NET developers in the long run, but if you're looking for a free tool that can do JavaScript Code Assist now I still recommend Aptana.


Ingo Muschenetz (Aptana) said...

Great that Aptana works so well for you. Have you tried associating ASPX files with the HTML editor? It should give you the color syntax highlighting back again:

Please let us know if we can be of any help.