Do any of the ColdFusion IDEs/IDE plugins allow you to perform actions similar to Visual Studio's go to definition and find usages (some details of which are on this page)?
For example, in one .cfc
file I might have:
<cfset variables.fooResult = CreateObject(
"component",
"Components.com.company.myClass").fooMethod()>
And in myClass.cfc
I have:
<cffunction name="fooMethod" access="public">
<!-- function body -->
</cffunction>
If I have my cursor set over .fooMethod
in the first file, a go to definition action should place me on the declaration of that method in myClass.cfc
.
At present I'm using the CFEclipse plugin for Eclipse to view some legacy ColdFusion.
CFEclipse doesn't have this functionality, partly because CFML is a dynamic language with a fair bit of complexity parsing-wise.
You can use regex searching to get you most of the way there in most cases.
Function Definitions
To find a function definition, most times searching for...
...is enough, and quicker than the more thorough form of:
Function Calls
To find a function call, against just do:
Though against you might need to be more thorough, with:
...if bracket notation has been used.
You might also want to check for cfinvoke usage:
Of course, neither of these methods will find if you have code that is:
...nor any other form of dynamic method names.
If you really need to be thorough and find all instances, it's probably best to search for the method name alone (or wrapped as
\bmethodname\b
), and manually walk through the code for any variables using it.