Prerequisite knowledge
Additional Requirements
Additional prerequisite knowledge
User Level
To make the most of this article, you need the following software and files.
ColdFusion Builder 2 Beta
Adobe ColdFusion Builder 2 code-named Storm is an IDE that helps you develop ColdFusion applications. The first version of ColdFusion Builder had many useful features such as syntax highlighting, Syntax Checking, Code Assist, code outline, code folding, project management, RDS and FTP support, debugger, server manager, and extensions. In ColdFusion Builder 2, we have enhanced many of these features and added many new features. This article provides an overview of these features to help you take full advantage of all the productivity tools provided in ColdFusion Builder 2. 

Editor enhancements

ColdFusion Builder 2 has many editor enhancements to make writing, viewing, and navigating CFML code easier. Improvements have been made in Code Assist and Code Folding. The new features include Quick Fix and Code Navigation.

Code Assist improvements

ColdFusion Builder 2 can automatically insert required tag attributes. When you select a tag name or attribute of a tag from the Code Assist proposal window—for example, if you type <cffunc and invoke Code Assist by pressing the key combination CTRL+SPACE on Windows; COMMAND+SPACE on Mac , ColdFusion Builder 2 completes the tag as cffunction and also inserts the required attribute of name . This works for function parameters as well. For example, if you type <cfset file and invoke Code Assist, you can then select fileopen from the function choices; ColdFusion Builder 2 then inserts fileopen filepath
Code Assist within ColdFusion Builder 2
Figure 1. Code Assist within ColdFusion Builder 2 can help you browse to a tag and its attributes, or to a function. 
ColdFusion Builder 2 also shows context information about function arguments when Code Assist is invoked within the function. The current parameter that is being typed is highlighted in bold. Optional parameters are displayed inside brackets [].
Some tags in CFML have key attributes that decide which remaining attributes are required in the tag. For example, the cfloop tag has key attributes of: array , collection , and condition . ColdFusion Builder 2 shows these typically used or required attributes at the top of the attribute options for that tag.
Attribute options
Figure 2. Code Assist prompts you to select attributes that you will most likely need to use for the ColdFusion tag that you are using. 
After you select any of the key attributes, all required attributes for the selected key attribute are automatically inserted.
You can configure Code Assist using preferences in ColdFusion Builder 2 to cycle Code Assist options. When you select this option in the Preferences dialog box which is the default option , ColdFusion Builder 2 first displays local variables, UDFs, and scopes in the option window, when Code Assist is invoked in assignment or expression. Invoking Code Assist again shows available options for functions. Invoking it again shows all Code Assist options. Repeated invocation of Code Assist cycles through these sets of proposals.
Code Assist to display more options
Figure 3. Code Assist by default shows the most commonly used options; clicking Ctrl+Space invokes Code Assist to display more options.
Code Assist for createObject is modified to show separate options for creating different kinds of object.
Code Assist
Figure 4. Code Assist creates different kind of objects. 
Code Assist proposals can be filtered for the containing text example.
Code Assist
Figure 5. Code Assist can filter containing text. 
Typing soap in the cfset and invoking Code Assist displays all function containing "soap". This makes it easy to find functions, variables, or tags using Code Assist, which can be extremely useful for maintenance of code.
Wherever ColdFusion Builder 2 can determine data type of variable/attribute, it shows variables, functions, or attributes of that data type See Figure 6 .
Code Assist
Figure 6. Code Assist will try to determine the data type of the variable, tag, function, attribute, and shows options appropriate to that data type. 
In Figure 6, variable st1 appears amongst the options in the list, but not the variable name , because ColdFusion Builder 2 knows that the first argument to structAppend function is struct and the name variable is assigned a string.

Custom and persistent code folding

The first version of ColdFusion Builder provided code folding options for pre-defined blocks of code, for example, for functions and tags. In ColdFusion Builder 2, you can select an arbitrary block of code and fold it.
Code folding in ColdFusion Builder 2
Figure 7. Code folding in ColdFusion Builder 2. 
In the code in the Figure 7, if you select lines 4 to 6 and then press Ctrl+Alt+F Windows or Command+Option+F Mac , the lines are folded and the code appears as follows:
Folded code.
Figure 8. Folded code.
ColdFusion Builder 2 also remembers the state of each folding in open files so that when you reopen the same file, states of all folding are restored.
You can remove custom folding created this way by placing the caret on the first line of folding and pressing Ctrl+Alt+F Windows or Command+Option+F Mac again. You can also right-click the code to add/remove folding functionality. Simply select the menu option Source > Toggle Folding once you right-click your code.
Note that you cannot add custom folding to a selection if you already have folded code at the starting line of the selection.

Tag block selection

You can now select a tag and its containing code from anywhere inside the tag by pressing keys Ctrl+Alt+B Windows or Command+Option+B Mac . For example, in Figure 7, by placing the cursor on line 5 and pressing Ctrl+Alt+B, ColdFusion Builder selects the cfreturn tag. Next, if you press the same key combination again, ColdFusion Builder 2 selects the parent of the cfreturn tag, which, in this case, is the cffunction tag block.
You can also use this key combination to select for and if block of code in the cfscript tag .

Jump to matching tag

You can use key combination Ctrl+Alt+M Windows or Command+Option+M Mac to jump between start and end tags when your cursor is on the opening or closing ColdFusion tag. For example, in Figure 7, if you place your cursor on line 7 inside the closing tag for </cffunction> and press Ctrl+Alt+M , your cursor jumps to the opening tag <cffunction> tag on line 3.
You can use this key combination to jump to opening and closing tags of the for and if block in the cfscript tag .

Quick Fix

ColdFusion Builder 2 allows you to generate functions, CFCs, and CFMs from their usage. That is, you can reference a function call before declaring the function and ColdFusion Builder 2 will give you options to generate function declaration, along with parameters used in the function calls. In ColdFusion Builder 2, you can find the Quick Fix option in the left margin on the line where your code calls the function. Clicking the Quick Fix icon presents you with the option to create function. You can also use Ctrl+1 Windows or Command+1 Mac keyboard shortcut while having your cursor on the line that contains the function call to see the Quick Fix options.
Quick Fix option
Figure 9. The Quick Fix option 
Quick Fix works for components in createObject , cfobject , cfinvoke, and for files inserted into files through the cfinclude tag, also.

Code navigation

ColdFusion Builder 2 provides you keyboard shortcuts to easily navigate through the code. Press Ctrl + Shift + Up/Down arrow keys Windows or Command + Shift + Up/Down arrow keys to jump to next/previous functions in the file. If you are in control blocks, like , if , and switch , you can use the same keyboard shortcuts to jump to the next logical block, for example:
Quick Fix option
Figure 10. Navigating code using keyboard shortcuts in ColdFusion Builder 2. 
If your cursor is on line 2 and you press Ctrl + Shift + Down Windows or Command + Shift + Down, ColdFusion Builder 2 selects the cfelseif statement on line 3 and your cursor moves to that line. Pressing the shortcut again moves the cursor to line 5, selecting the cfelse tag.
You can use CTRL+] to move to the next tag attribute and CTRL+[ to move the previous tag attribute. The same keyboard shortcuts work to navigate between function parameters. For example:
If your cursor is on the function name and you press CTRL+], ColdFusion Builder selects the first parameter, webservice the cursor moves to the beginning of this parameter.

Hover Help

ColdFusion Builder 2 displays help for built-in tags, function, and User Defined Functions UDF when you place your mouse ie, when you hover over the tag or function. For UDFs, value of hint attribute is displayed in the help window.
<cfset addSOAPRequestHeader (webservice,namespace,name,value,mustunderstand)>
Figure 11. Hover help for UDF.
Figure 12. Hover help for built-in tag.

Code Formatter

ColdFusion Builder 2 has extensive support for formatting code. The Code Formatter can format mixed code containing CFML, HTML, JavaScript, and CSS too.
Press Ctrl+Shift+F Windows or Command+Shift+F Mac to format existing code. To format only a section of the code, select the code and press the same key combination. You can also use the editor context menu option by using a right-click while selecting your code.
The Code Formatter formats code by indenting the code appropriately as you type it.

Formatting preferences

ColdFusion Builder 2 provides many options to control the way you want to format the code. Go to menu Preferences >ColdFusion >Profiles>Editor>Formatter.
Figure 13. Formatting code with Code Formatter.
In addition to including a default formatter profile, ColdFusion Builder 2 also allows you to create custom profiles to store your preferred set of formatting options. A preview of formatted code using active profile is displayed in the preview window. This window gives you a quick snapshot of current formatting settings.
You can create a new profile by clicking the Add button.
Figure 14. Saving formatting options for individual profiles. 
The options in the General tab allow you to set case of tags and attributes and option to add /> to the end of the tag. In the Indentation tab, you can set tab size, select tab or spaces for indentation, select indentation size and specify tags which should not be indented.
Figure 15. Specifying your preferences for formatting options.
As shown in figure 15, the Whitespace tab contains many options to manage white spaces during formatting.
The Wrapping tab contains options to control wrapping of tag attributes, function parameters, array and struct initializers, and general text. You can specify options for placement of curly braces in the cfscript tag in the Braces tab.

Advanced Find & Replace

ColdFusion Builder 2 provides an enhanced search feature that allows customized search for CFML code. You can invoke a search dialog in CFML file using the keyboard shortcut Ctrl+F Win or Command+F Mac , or from the main menu: Search >ColdFusion Search.
Figure 16. Using the advanced ColdFusion Search functionality.
The Scope field specifies where ColdFusion Builder 2 will search: in the current document, open documents, projects, working sets, workspace, local directory, FTP location, or RDS location.
The Search field specifies the mode of the search. Text mode allows you to perform conventional text search, while the Tag mode allows you to search for a tag with tag-specific search criteria.
Figure 17. Search tags using tag-specific search criteria, such as attribute, value, and so forth; and specify an action to perform on the tag. 
When performing a Replace action in Tag search mode, you can specify many actions that have to be performed on the tags in the search result. For example, the Action that you specify can be to replace a tab block, remove a tag block, set an attribute, remove an attribute, add text before/after tag, and so forth.
ColdFusion Builder 2 displays a preview of changes before performing a "Replace all" operation, however, this only works for the search scopes of Current Document, Project, and Workspace.
Figure 18. Specify the replace action that you wish your search to perform. 
When you press the Replace All button in the ColdFusion Search dialog box, ColdFusion Builder 2 allows you to preview the changes it perform on the file s .
Figure 19. You can preview the replace action before committing to it. 
If you press the Find All button in the ColdFusion Search dialog box, ColdFusion Builder 2 shows all search results in the Search window.
Figure 20. Using the Find All functionality in the search functionality. 

Extension enhancements

ColdFusion Builder 2 extensions allow you to extend the functionality of the IDE, for example, by contributing new context menu options in different views and CFML editor and linking those menu options to handlers on the ColdFusion Server. Thus, you can extend ColdFusion Builder by writing CFML scripts that are executed on the ColdFusion Server. There are many ColdFusion Builder extensions already contributed by the community on the RIAForge.
Note that this article does not go into the details of developing extensions for ColdFusion Builder 2, as it is beyond the scope of this article. Please see the ColdFusion Builder documentation for complete details, and watch the video tutorial, What's new with extensions in ColdFusion Builder 2, by Ray Camden, which outlines great new functionality you can build in ColdFusion Builder 2 with Extensions. This section briefly describes the new features added in the ColdFusion Builder 2 extension framework.

Extension callback

In the first release of ColdFusion Builder, communication between ColdFusion Builder and the extension handler running on ColdFusion Server was largely one way. That is, ColdFusion Builder requested the handler to perform an action and the handler returned the result. During execution of the handler, there was no way to attain more information from ColdFusion Builder. Now the extension handler can request that ColdFusion Builder 2 execute commands and retrieve additional information, for example, regarding projects, files, or data sources.

Extension contribution to Code Assist

Extensions can now contribute Code Assist requests for functions and function arguments. You need to specify Code Assist contribution in the extension's configuration file and specify function names and arguments for which your extension can contribute Code Assist requests. Code Assist requests are actually computed in the extension handler.

Running extensions in view

Extension authors now have choice of running extensions in a dialog box or in a non-blocking view. In ColdFusion Builder, extensions used to always run in a modal dialog box, which was not suitable for extensions that required a non-blocking user interface. When you create an extension, you can create custom buttons in the extension toolbar.

Extension contribution to the start page URL

Extensions can contribute to the start page URL of the project. This is useful for framework authors to dynamically create a start page URL when you run a ColdFusion page from ColdFusion Builder 2.

Other enhancements

Task tags

ColdFusion Builder 2 makes it easy to manage coding tasks with configurable task tags such as TODO and FIXME. These two tags are configured by default. You can manage tasks by going to Preferences>ColdFusion>Profiles>Editor>Task Tags.
If you start a CFML comment with any of the task tags configured in the preferences, then that task is added in the tasks view. This makes it easy to keep track of programming tasks in files.
Figure 21. Setting up tasks within code. 

Custom keyboard shortcuts

ColdFusion Builder 2 is configured with keyboard shortcuts for commonly used HTML and CFML tags. But you can easily create your own keyboard shortcut for inserting text in the editor. Go to Preferences >ColdFusion>Profiles>Keys and click the Add button.
Figure 22. Setting up keyboard shortcuts. 
In Figure 22, I have added a keyboard shortcut for inserting a cfoutput tag when a user presses CTRL+SHIFT+O. You can specify the cursor position after inserting the text as $${CP}. Thus, in the above example, the cursor is placed between the opening and closing tag after inserting the text.

Setting the start page

ColdFusion Builder 2 adds the capability to set a start page for a ColdFusion project. You can right-click any file in the Navigator view and then select the Set As Start Page menu option. You can see start page set currently for the project by opening project properties.
Figure 23. Setting the start page. 
The Start page specified above opens in the browser when you run or debug a CFML page within that ColdFusion project.

Creating CFM files from file view

ColdFusion Builder 2 now lets you create CFML/CFC files on your local disk from File view at the lower left corner in the default ColdFusion Development perspective. The advantage is that, you can create CFM files outside the workspace, which was not possible earlier. To create CFM file, in the File view, right-click any local folder and then select New > ColdFusion Page/Component/Interface.

Where to go from here

ColdFusion Builder 2contains many developer productivity features such as improved Code Assist, Code Navigation, Quick Fix, and Advanced Find and Replace. It also has a robust Code Formatter which helps to improve readability of the code. The enhancements to Extension support enables framework developers to develop extensions for their framework. This can potentially make usage of frameworks very easy for the end developers.
The goal of this article is to provide you an overview of different features in ColdFusion Builder 2. Please read the complete documentation of ColdFusion Builder 2 for details on how to use these features.
See the other articles on using ColdFusion Builder 2: