The ColdFusion IDE, the equivalent of Visual Studio "go to definition" and "find ways to use it,"

Does any of the ColdFusion IDE / IDE plug-ins create actions similar to Visual Studio to identify and search for usage (some of the details are on this page )?

For example, in a single .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, going to the definition action should put me in the declaration of this method in myClass.cfc .

I am currently using the CFEclipse plugin to view Eclipse for legacy ColdFusion.

+7
coldfusion cfeclipse
source share
2 answers

CFEclipse does not have this feature, in part because CFML is a dynamic language with reasonable complexity analysis.

You can use regular expression searches to get most of the time from you.

Function Definitions

To find the definition of a function, in most cases a search ...

 (name="|ion )methodname 

... enough and faster than a more complete form:

 (<cffunction\s+name\s*=\s*['"]|\bfunction\s+)methodname 

Function call

To find a function call, simply do:

 methodname\s*\( 

Although you may need to be more thorough, with:

 ['"]methodname['"]\s*\]\s*\( 

... if notation notation was used.

You can also check cfinvoke usage:

 <cfinvoke[^>]+?method\s*=\s*['"]methodname 

Of course, none of these methods will detect if you have code:

 <cfset meth = "methodname" /> <cfinvoke ... method="#meth#" /> 

... and no other form of dynamic method name.


If you really need to be thorough and find all instances, it is probably best to look only for the method name (or wrapped as \bmethodname\b ) and manually look through the code for any variables that use it.

+3
source share

IF you use

 <cfset c = new Components.com.company.myClass()> <cfset variables.fooResult = c.fooMethod()> 

I believe in CFBuilder, you can press Ctrl, and the CFC class and method will turn into a hyperlink. See "Code Penetration" at http://www.adobe.com/ca/products/coldfusion-builder/features.html It works when it works, it does not happen when the mapping is incorrect, or some syntax is not supported. I'm not sure if they support the CreateObject() method.

There is no use as CF is not a static language. However, Find can find what you need most of the time if the code does not call the method dynamically or uses Evaulate()

+3
source share

All Articles