I was poking around ColdFusion Builder today, trying to get objects from my common library to display the code assist (aka code hints) popup. As described in various blogs (I read this one and this one) as well as in the CFB help files, you simply go into your project’s Properties > ColdFusion Variable Mappings section, add the variable name alias and the “fully qualified” cf dot-notated path to the object.
Well darn it all, it doesn’t always work, does it? It turns out that “fully qualified” really means relative-to-your-project, not the webroot. So because my common folder resides in the filesystem outside of my TestProject folder, CFB can’t find it and won’t display code hints.
After posting a comment to this effect one one of the above blogs, I remembered folder linking from Flex, and lo and behold, it works lovely for ColdFusion variable mappings! So here’s how to do it.
Step 1: create a new folder in your project
Step 2: Click the advanced button, and check “Link to folder in the file system”
Step 3: See that variables button? Click it
Variables? It turns out Eclipse supports path variables, which can be used as shortcuts in path names. A prime opportunity to map the web root to a variable since it’ll be used a lot: here you see I am mapping my J2EE webroot folder to “www”:
Click OK a couple times to get back to the new folder window from step 2.
Step 4: create your linked folder
Now you want to enter the path to your external code directory (using the path variable you just created), and optionally modify the folder name:
Click finish and voila! You have a linked directory inside your project:
The linked directory is now available for CFB to use when resolving ColdFusion Variable Mappings settings. Remember that first screenshot where I created the udf variable mapping? Let’s test it out now:
Excellent!! Just what the doctor ordered. Happy coding!