Komodo-CFML

Introduction

Komodo-CFML screenshot

A partial screenshot of CFML within Komodo, showing some of the syntax highlighting (2014-03-01)

Komodo-CFML is a project I’ve undertaken to develop a reasonably functional CFML language mode for ActiveState’s Komodo Edit and Komodo IDE multi-language editor environments. I’ve long thought the Komodo platform an attractive base for CFML development, given it’s availability for the three major OS’s (Mac OS X, Linux, and Windows) and it’s reasonably full feature set, particularly:

  • syntax support for a wide variety of languages
  • extensibility via macros, snippets, abbreviations, and full-blown editor extensions for both additional languages and additional functionality
  • lots of the normal editor bells and whistles that I tend to look for that set higher-end editors apart from others: code folding, block selection, indentation marking, flexible key binding
  • a freely-available version (Komodo Edit) as well as the more feature-rich pay version (Komodo IDE)

Capabilities

My intent is that Komodo-CFML will eventually provide all of the following:

  • full syntax highlighting support for CFML, as implemented not just by Adobe’s ColdFusion application server but also the additional tags and functions provided by CFML offerings from Railo, NewAtlanta’s BlueDragon, and the OpenBD project. In doing so, it should support
    • CFML by itself, within HTML, within CSS, within JavaScript, and within SQL in CFQUERY tags,
    • full syntax highlighting for all of the above-mentioned languages (HTML, JavaScript, CSS, SQL) when they occur in CFML language files,
    • syntax highlighting for CFSCRIPT within CFML files, and
    • some (possibly limited) syntax highlighting for custom tags and tags loaded as tag libraries via CFIMPORT.
  • access to tag completion, smart indenting, code folding support, etc., for the HTML, CSS, and JavaScript languages when they occur in CFML files,
  • tag completion, smart indenting, code folding, etc., for CFML tags
  • recognition (e.g., appropriate syntax highlighting) of known variables in language scopes (e.g., cgi.remote_Host) as keywords

Current Status

I’m at a v. 0.2.3 release as of February 2014. I have most of the desired capabilities related to the syntax highlighting complete; I’ve been using it in one form or another as my primary CFML editor almost exclusively since late December 2009. At present, there are several notable items from the above list, however, that are not yet implemented:

  • Highlighting of known variables in language scopes (e.g., cgi.remote_Host)
  • Function “insight” to provide help with CFML functions

Look for posts on this blog tagged with komodo-cfml for more detailed information about current status and recent updates.

Roadmap

My plans for Komodo-CFML are something like this:

  • 0.1.0: Full syntax support for CFML; first public release
  • 0.1.5: Better code folding support, so that CFML tags that can’t (as opposed to don’t have to) have closing tags can be written with either XML style tag ends (i.e., “/>”) or with just a simple ending (“>”) and the folding logic won’t try to provide folding
  • 0.2.0: Auto-completion for (most) CFML tags, and support for different vendors’ implementation of CFML
  • 0.3.0: Function insight for (most) CFML functions

You might notice I haven’t included the desired support for highlighting known variables in defined language scopes (e.g., my “cgi.remote_Host” example) on the roadmap; this is mostly because at this time I don’t have a feel for whether anyone (other than me) cares about this and because at this point I’m not at all sure I can get there. I’ve given this a try a couple of times and have come away with implementations that mostly work but eventually break down. It’s probably one of those things I will occasionally poke at when I have a few spare cycles and if I’m successful, I will include it in some sort of interim release off the map.

Installation Notes

Komodo file mode selection list

File mode selection list, after installing Komodo-CFML — note CFML is now available

Installation: Installing the CFML mode itself is as simple as downloading the .xpi file (below) and dragging it onto a running instance of Komodo. Komodo will warn you that you should only install extensions from sources you trust… if you’re up for it, select “Install” and Komodo will ask you to restart. Once restarted, Komodo should now have CFML as an available choice in the list of supported modes (as shown at right). Select “CFML” and start playing…

File Associations: Installing the editor extension registers only a single file assocation as a CFML type: .cfml files. Most of us will want .cfm and .cfc as additional extensions automatically treated as CFML files. Go to “Preferences > File Associations” and add both of these (and any others appropriate for your use), selecting “CFML” as the language associated with each file type.

Fonts/Colors: Fonts and colors for the different CFML language tokens can be set via “Preferences > Fonts and Colors”, using the “Lang-Specific” tab and choosing CFML as the language. The Komodo-CFML extension has some example CFML embedded; that example will be shown there so you can see how CFML will be rendered. Most of the language tokens are the same as other languages (e.g, HTML5).

HTML and CFML Tag Completion: As of v. 0.2.0 or later, Komodo-CFML implements CFML support as an extension of HTML and relies upon DTDs defining the set of additional tags and their attributes extending the base language. Installing Komodo-CFML v. 0.2.0 or later will include one or more additional DTD in Komodo’s list of default HTML document types. In order to enable CFML tag completion, you will need to select that DOCTYPE from the list provided under Preferences > Languages > HTML (that list is sorted alphabetically; look for the CFML related DOCTYPEs toward the bottom, beginning with “-//WE3GEEKS//”).

Downloads

Editor extension: cfml-0.2.3-ko.xpi (recommended), cfml-0.1.7-ko.xpi (deprecated and no longer actively supported)

Release Notes and To-Do List

  • 2013.06: v. 0.2.3
    updates to CFML dialects (including an initial partial Railo-specific dialect — not yet recommended for real use); re-worked SQL syntax support; fixed a couple typos in CFML tag attributes; fixed issue with cfreturn syntax highlighting
  • 2013.03: v. 0.2.1 (update)
    minor update to work with with ActiveState’s official release of Komodo v8
  • 2012.12: v. 0.2.1 (update)
    minor update to work with ActiveState’s recently announced alpha of Komodo v8; minor updates to CSS, JavaScript, and HTML highlighting within CFML files for a little better consistency with those languages in their respective separate files
  • 2012.06: v. 0.2.1 (update)
    minor update to highlight HTML numerical character entities better; fix to Adobe ColdFusion 10 DTD
  • 2012.04: v. 0.2.1
    initial support for Adobe ColdFusion 10; minor fixes in Adobe ColdFusion 9.01 tag attributes
  • 2011.11: v. 0.2.0 preview
    initial release in the v. 0.2-series; support for CFML tag and attribute completion for Adobe ColdFusion 9; compatibility with ActiveState’s Komodo Edit/IDE v. 7-series
  • 2011.01.23: v. 0.1.7
    fixed a couple minor syntax highlighting problems in SQL;
    updated support for all Railo v3.2 CFSCRIPT keywords;
    added support for ACF9′s “required” keyword for CFSCRIPT function arguments;
    added highlighting for CFML-crunched stuff in CFML strings and non-string CFML tag attributes;
    added highlighting for CFML-crunched stuff in SQL and in SQL strings in CFML files;
    added highlighting for CFML-crunched stuff between HTML tags in CFML files;
    added highlighting for CFML-crunched stuff in JavaScript in CFML files;
    updated CSS support in CFML files so that hex color specifications are highlighted as “numbers”;
    initial support for pure CFSRIPT components;
    updated tidy-cfml.config to include all tags based on ACFv9, Railo v3.2/3.3, OpenBD
  • 2010.10.03: v. 0.1.6 (preliminary) — Updates to fix a problem with the tokenizing of CFML constants true/false/null when immediately followed by a operator like a closing paren; folding on “{” and “}” in CFSCRIPT; tweaked the extension title for consistency with other UDL-based language extensions.
  • 2010.03.30: v. 0.1.5 — Updates to make folding support smarter, as CFML tags that can’t (as opposed to don’t have to) have closing tags can now be written with either style tag ending (“/>” or just “>”) and the editor won’t try to allow folding if the second of those styles is used.
  • 2010.02.17: v. 0.1.1 — Updates to better handle unquoted attribute values in CFML start tags; support for nested CFML comments
  • 2010.02.15: Initial release of v. 0.1.0

Feedback

All comments and feedback — particularly if you see oddities in the highlighting of the CFML code — are welcome. Just leave a comment below.

Thanks

Finally, a few words of thanks are in order, since I couldn’t have done this on my own:

  • Thanks to ActiveState for a pretty incredible platform in Komodo to build on, and in particular ericp and toddw on the ActiveState team for their continued patience and answers to questions on the Komodo forums and via e-mail.
  • Thanks to my guinea pig testers who put up with all the shoddy code I force on them as I create interim builds for testing; particular thanks to Jeff Caldwell and Aaron Roberts, who always seem willing to run with scissors next to the swimming pool immediately after eating.
  • Thanks to all of you who have provided feedback on both the Komodo-CFML editor extension and on this page. Keep it coming, please!

32 thoughts on “Komodo-CFML”

  1. Hey Ron,

    thanks so much for this; working perfectly.
    I’ve been looking for a good replacement editor since Homesite+ started acting the maggot and now I can use Komodo.

    Good work.

    Cheers,
    Peter

  2. Great start on this! I jump between XP and Ubuntu, PHP and CFML and have been looking for the ideal editor. So far Komodo is in the lead especially thanks to your work here.

  3. @Ryan: Thanks! I’ve got a couple other minor changes I still need to push out to those of you that are using it. I’ve been doing some digging to figure out how to get the code intelligence for CFML tags working… looks to be a bit of rework there to get that in place.

  4. @Ryan: I will follow up with you via e-mail, as I’d like to see what you’re encountering. This isn’t something I’ve come across or had reported from some of the other people using the extension.

  5. Ok, my submission clearly took my code to be html. Let’s try again.

    When I use <cfimport taglib=”/path/to/lib” prefix=”data”>, the syntax highlighter show that <data:my_tag> is not recognized. Is there a way to fix this?

  6. @CITguy: quick answer is “yes” — this is a function of how Komodo deals with tags and validation of HTML-based languages. If you add the tags from your tag library to either the “new-block-level-tags” or “new-empty-tags” entries in the HTML Tidy configuration file, they will no longer be considered unknown or invalid tags. For instance, if you are loading a framework library with a prefix of “fw” and it has empty tags for page header and page footer called “header” and “footer”, respectively, you would add “fw:header” and “fw:footer” to the comma-delimited list of tags on the “new-empty-tags” line of the corresponding configuration file. Refer to the “Tag Validation” portion under “Installation”, above, for a bit more on setting up the tag validation.

  7. I’ve just started dabbling in ColdFusion for a work project and thought I might have to change my editor away from Komodo to something like Dreamweaver. Then I stumbled across this little gem.

    Fantastic! You really ought to get in touch with the Komodo chaps and see about getting this added in as a default :)

  8. Hey thanks for this its awesome that I can use a really fast editor for ColdFusion instead of having to use the slow Aptana or spend the money on Dreamweaver. This is awesome, thank you.

  9. @Darren L: Glad you like it; keep an eye here… I’m getting close to a first 0.2.0 release which will support Komodo’s “code intelligence” for CFML tags (auto-complete for tags and their attributes), like it already does for HTML tags.

  10. Thank you for this. I just started using Komodo for php and i really like it. I’ve been wanting to move away from Homesite+ for a long time now and with this addition i think it might finally be the push i needed. I do a lot of CF (and have a lot of old CF code i need to maintain) and PHP and this is the perfect editor so far. Plush i can use on Win, Ubuntu, and Mac!

    Thanks again — look forward to the tag completion update!

  11. thanks a lot for sharing this beauty. Ever since homesite and thecoldfusion studio was discontinuel, its being a pain working with the eclipse or coldfusion builder.
    Ive also have dreamweaver but I hate it.. Komodo is really nice..

  12. Awesome extension! I can finally utilize one IDE for all my development (ruby, node.js, CF). Until now, it’s been a real pain having to switch back and forth to separate IDEs. Thanks for a great v. 0.2.0. Good bye Adobe ColdfusionBuilder!

  13. @Christopher: Thanks, and I’m glad to hear you like it. There are still some idiosyncrasies in there that I’m trying to track down and I’ll have a version out before too long with support for the changes in Adobe’s CF10.

  14. I truly appreciate your work in exposing me to another editor that will do exactly what I need it to do without fail. I’ve grown upset with Adobe for not embracing cfeclipse and instead producing a costly similar product that is severely flawed and lacks the ability to be properly patched when bugs are discovered.

    I’m new to Komodo Editor, the jury is out if I’m going to buy the IDE yet, and I can’t locate a way to make use of the tidy-cfml.config file provided above. Thanks!

  15. Your extension works perfectly, i was really looking for a good editor when i moved over to mac. before i used notepad ++ on windows and this works just as good if not better.

    Thanks for all your hard work!!

  16. @Pete: To set up the tidy-cfml.config file, go to Preferences > Syntax Checking, then select “HTML5″, and you will have the ability to enable checking with HTML-tidy. Once enabled, you can specify a configuration file… and that’s where that file comes into play. May want to do the same for HTML. I will update that information above, too, as it looks like it has changed with v7.

    @Pete and Scott: Thanks for the feedback. I’m still really just scratching the surface of what Komodo can do; it’s a pretty amazing platform.

  17. Is there anyway to combine “html5″ and “CFML” ? I get red squiglies for tags like section,article,header, etc… or is there an ignore list of sorts.. ?

  18. @Critter: Pull down the updated (mid-June 2012) copy of the tidy-cfml.config file and point Komodo at it; this is a function of how Komodo v6 deals with HTML (and therefore CFML) tag validation. I’ve updated the file to include separate stanzas for various combinations of ACF 9 and ACF10 with and without the additional HTML tags from the current draft of the HTML5 spec. After looking into this, I think this behavior is specific to versions of Komodo prior to v7, as they changed the way validation is handled… and I probably need to do some digging to figure out how to get “real” CFML validation implemented in v7.

  19. Thanks for this. I hope you keep up the good work… it’s so hard to find an IDE/text editor that supports CFML. It seems like CFEclipse is dead and the Notepad++ plugin for CFML isn’t being supported anymore.

  20. @Travis: Thanks; hope it is of some value to you. I’ve been in sort of a lull in terms of working on it, but am close to having my plate cleared off again to a point where I can dig back into some of the other capabilities I’d like to have working.

  21. Hello, thanks for make this great extension, it’s very useful for me.
    Recently I updated to Komodo 8.5 and the autocomplete doesn’t show like in the previous version.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

musings on books, technology, food, faith, adoption, and life in a family of geeks