FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

function-linenums

v1.1.2 Public

function-linenums

function-linenums is a utility module for use with CFML exception TagContext arrays. Given a template and a line number it computes CFML function names - as tag context items do not include original CFML function names in them.

Installation

Install this module via CommandBox:

$ install funclinenums

Alternatively the git repository can be cloned into the desired directory.

ColdBox Module

You can leverage the module via the injection DSL: [email protected]:

property name="functionLineNums" inject="[email protected]";

Standalone Usage

Alternatively, the functionLineNumbers component can be instantiated directly:

functionLineNums = new funclinenums.functionLineNums();

Available methods

The following methods are available:

// pass in a TagContext item directly
functionName = functionLineNums.findTagContextFunction( tagContextItem );
// pass in a full path to a CFML source file and a line number
functionName = functionLineNums.findFunction( fullPath, lineNum );
// pass in a full path to a CFML source file
functionArray = functionLineNums.getFunctionRanges( fullPath );
/*
returns an array of structs:
[
    {
        "name": "funcName", 
        "start": 1, 
        "end": 104, 
        "startline": 1,
        "endline": 9
    }
]
*/
// pass in source code directly
functionArray = functionLineNums.walk( srcCode );
/*
returns an array of structs:
[
    {
        "name": "funcName", 
        "start": 1, 
        "end": 104, 
        "startline": 1,
        "endline": 9
    }
]
*/

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
1.1.2 Nov 27 2019 10:18 PM Nov 27 2019 10:18 PM
Version History
1.1.1 Jul 19 2019 02:29 AM Jul 19 2019 02:29 AM
1.1.0 Jul 18 2019 04:42 PM Jul 18 2019 04:42 PM
1.0.0 Jul 13 2019 12:35 PM Jul 13 2019 12:35 PM

 

No collaborators yet.
     
  • Jul 13 2019 12:35 PM
  • Nov 27 2019 10:18 PM
  • 211
  • 0
  • 3,572