Some Oohs and Aahs in ColdFusion Builder 2

Posted: May 2, 2011 in ColdFusion

While doing a little tinkering in my ColdFusion Builder 2 Beta I accidentally ran across some features while editing a ColdFusion file. These appear to be all new from version 1 and will be a great time-saver for me!

Code hyperlinks for CFCs and UDFs
Component names and UDFs are hyperlinked if you press Ctrl and hover over the object name. Clicking the hyperlink opens the corresponding code. According to Adobe Help, code hyperlinks are available for:

  • UDFs: local, included, and cfc.udfName
  • Template in <cfinclude template=””>
  • CFCs in createobject(), <cfobject>, <cfinvoke>, new keyword, and extends attribute.

Ctrl+Shift+R (Open Resource…)
Another resource worth mentioning, but is not new is the Open Resource window. Apparently it’s been around a long time in Eclipse, but I just learned about it.

When you open the window, you can start typing a name of a file which will bring up a list a matching files located in your project. For example “tests” may bring up “TestSuite.cfc”, “TestSimple.cfm”, and “TestSomething.html”. In addition you can select the resulting file to find its path and open it either in its specific or default editor.

However the best part of this is if you highlight a file reference in your code, then press Ctrl+Shift+R it will bring that highlight into the search filter readily giving you access to the file you are searching for. This can be especially handy if you can’t use the code hyper-link due to component searching, which ColdFusion Builder can’t resolve yet.

Explore Files and Copy Path(s) to Clipboard
While a file is open to edit, right click for the context menu. Here you will see two commands listed:

  • Explore Files
  • Copy path(s) to clipboard

“Explore Files” will open your Windows Explorer to the path of that currently open file and focus to the file name.

“Copy path(s) to clipboard” will copy the path of the open file to your clipboard. Example: “C:\websites\myfile.cfm”

Advertisements
Comments
  1. Adam Tuttle says:

    I’m fairly sure that the “Code hyperlinks” feature is not new in CFB2, though it’s been a while since I last used CFB1 so I could be wrong.

    • Chris says:

      It appears you may be right Adam. The version 1 docs do have it in there. I just assumed it wasn’t since my co-works version was showing the hyper-link when we tried.

  2. Mark Gregory says:

    Code Hyperlinks in CFB1 only take me to other points within the same file. I took it to mean that CFB2 would open other files. For example, I could click myObj = new someCFC() and have it open someCFC.
    Is there some way that CFB1 can do that? I haven’t seen it.

    • Chris says:

      You are correct Mark. CFB2 will open the referenced file. I’m not sure if this can be done in CFB1, but I’m guessing not.

  3. Jake says:

    They still have a ways to go before they have the simplicity of FlashBuilder.

    If I create a component, I want to be able to Ctrl + click on the variable name and it should take me to where it is declared. I.E. application.myCFC = createObject()… whenever I do application.myCFC.doSomething() I should be able to Ctrl + Click on the myCFC part and it’d take me to the cfc creation line. if I Ctrl + click on “doSomthing” it should take me right to that function in the CFC. This only appears to work on the variable declaration line where you actually use createObject. It’s a nice idea, but seriously, who actually creates an object over and over in the code rather than only declaring it when needed.

    • Chris says:

      Jake – in CFB2 you now have this ability. If you CTRL-click the object file reference it will open the CFC file on line 1. If you CTRL-click the method reference of that object it will open the referenced object file and take you directly to the method being called. I don’t think this happens in CFB1.

  4. The code hyperlink feature is not new, but for it to work for files that can’t be resolved as relative to the current file, then you need to have defined a server connection for CFB to ask CF where to find all your files, like CF would fund them: mailings, custom tag paths, etc.

    • Chris says:

      Thanks for the input Charlie. The only part I haven’t got to work about that though is CFC searching. For example if I do “a.b.c.myCFC” it will work both in CF and CFB. However when I do “myCFC” it will only work in CF; CFB will not attempt to go find it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s