(cfml_view, position)
return None, None, None, None, None
returns cfc_path, file_path, dot_path, function_name, regions
returns cfc_path, file_path, dot_path, function_name, regions
returns cfc_path file_path dot_path function_name regions
def find_cfc(cfml_view, position):
    """
    returns cfc_path, file_path, dot_path, function_name, regions
    """
    if cfml_view.view.match_selector(position, "entity.other.inherited-class.cfml"):
        r = utils.get_scope_region_containing_point(
            cfml_view.view, position, "entity.other.inherited-class.cfml"
        )
        cfc_path = cfml_view.view.substr(r)
        file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
        return cfc_path, file_path, dot_path, None, [r]

    if cfml_view.view.match_selector(position, component_selector):
        r = utils.get_scope_region_containing_point(
            cfml_view.view, position, component_selector
        )
        cfc_path = get_component_name(cfml_view.view.substr(r))
        file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
        return cfc_path, file_path, dot_path, None, [r]

    if cfml_view.view.match_selector(position, constructor_selector):
        r = utils.get_scope_region_containing_point(
            cfml_view.view, position, constructor_selector
        )
        cfc_path = cfml_view.view.substr(r)[4:].split("(")[0]
        file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
        return cfc_path, file_path, dot_path, None, [r]

    if cfml_view.view.match_selector(
        position, "string.quoted.single.cfml, string.quoted.double.cfml"
    ):
        r = cfml_view.view.extract_scope(position)
        cfc_path = cfml_view.view.substr(r)
        if cfc_path[0] in ['"', "'"]:
            cfc_path = cfc_path[1:-1]
        if is_cfc_dot_path(cfc_path):
            file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
            if file_path:
                return cfc_path, file_path, dot_path, None, [r]

    if cfml_view.view.match_selector(position, "meta.function-call.method"):
        function_name, function_name_region, function_args_region = cfml_view.get_function_call(
            position
        )
        funct_region = sublime.Region(
            function_name_region.begin(), function_args_region.end()
        )
        if cfml_view.view.substr(function_name_region.begin() - 1) == ".":
            dot_context = cfml_view.get_dot_context(function_name_region.begin() - 1)
            if len(dot_context):
                if cfml_view.view.match_selector(
                    dot_context[-1].name_region.begin(),
                    "meta.instance.constructor.cfml",
                ):
                    r = utils.get_scope_region_containing_point(
                        cfml_view.view,
                        dot_context[-1].name_region.begin(),
                        "meta.instance.constructor.cfml",
                    )
                    cfc_path = cfml_view.view.substr(r)[4:].split("(")[0]
                    file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
                    return (
                        cfc_path,
                        file_path,
                        dot_path,
                        function_name,
                        [r, funct_region],
                    )

                if cfml_view.view.match_selector(
                    dot_context[-1].name_region.begin(),
                    "meta.function-call.support.createcomponent.cfml",
                ):
                    r = utils.get_scope_region_containing_point(
                        cfml_view.view,
                        dot_context[-1].name_region.begin(),
                        "meta.function-call.support.createcomponent.cfml",
                    )
                    cfc_path = get_component_name(cfml_view.view.substr(r))
                    file_path, dot_path = get_cfc_file_info(cfml_view, cfc_path)
                    return (
                        cfc_path,
                        file_path,
                        dot_path,
                        function_name,
                        [r, funct_region],
                    )

                if is_possible_cfc_instance(dot_context):
                    cfc_path, file_path, dot_path, temp, regions = find_cfc_by_var_assignment(
                        cfml_view, position, dot_context[0].name
                    )
                    if regions:
                        regions.append(dot_context[0].name_region)
                        regions.append(funct_region)
                    return cfc_path, file_path, dot_path, function_name, regions

    if cfml_view.view.match_selector(position, "variable.other, meta.property.cfml"):
        var_region = cfml_view.view.word(position)
        dot_context = cfml_view.get_dot_context(var_region.begin() - 1)
        if len(dot_context) == 0 or (
            len(dot_context) == 1 and dot_context[0].name == "variables"
        ):
            cfc_path, file_path, dot_path, temp, regions = find_cfc_by_var_assignment(
                cfml_view, position, cfml_view.view.substr(var_region).lower()
            )
            if regions:
                regions.append(var_region)
            return cfc_path, file_path, dot_path, temp, regions

    return None, None, None, None, None
def find_cfc ( cfml_view , position ) : if cfml_view . view . match_selector ( position , "entity.other.inherited-class.cfml" ) : r = utils . get_scope_region_containing_point ( cfml_view . view , position , "entity.other.inherited-class.cfml" ) cfc_path = cfml_view . view . substr ( r ) file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) return cfc_path , file_path , dot_path , None , [ r ] if cfml_view . view . match_selector ( position , component_selector ) : r = utils . get_scope_region_containing_point ( cfml_view . view , position , component_selector ) cfc_path = get_component_name ( cfml_view . view . substr ( r ) ) file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) return cfc_path , file_path , dot_path , None , [ r ] if cfml_view . view . match_selector ( position , constructor_selector ) : r = utils . get_scope_region_containing_point ( cfml_view . view , position , constructor_selector ) cfc_path = cfml_view . view . substr ( r ) [ 4 : ] . split ( "(" ) [ 0 ] file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) return cfc_path , file_path , dot_path , None , [ r ] if cfml_view . view . match_selector ( position , "string.quoted.single.cfml, string.quoted.double.cfml" ) : r = cfml_view . view . extract_scope ( position ) cfc_path = cfml_view . view . substr ( r ) if cfc_path [ 0 ] in [ '"' , "'" ] : cfc_path = cfc_path [ 1 : - 1 ] if is_cfc_dot_path ( cfc_path ) : file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) if file_path : return cfc_path , file_path , dot_path , None , [ r ] if cfml_view . view . match_selector ( position , "meta.function-call.method" ) : function_name , function_name_region , function_args_region = cfml_view . get_function_call ( position ) funct_region = sublime . Region ( function_name_region . begin ( ) , function_args_region . end ( ) ) if cfml_view . view . substr ( function_name_region . begin ( ) - 1 ) == "." : dot_context = cfml_view . get_dot_context ( function_name_region . begin ( ) - 1 ) if len ( dot_context ) : if cfml_view . view . match_selector ( dot_context [ - 1 ] . name_region . begin ( ) , "meta.instance.constructor.cfml" , ) : r = utils . get_scope_region_containing_point ( cfml_view . view , dot_context [ - 1 ] . name_region . begin ( ) , "meta.instance.constructor.cfml" , ) cfc_path = cfml_view . view . substr ( r ) [ 4 : ] . split ( "(" ) [ 0 ] file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) return ( cfc_path , file_path , dot_path , function_name , [ r , funct_region ] , ) if cfml_view . view . match_selector ( dot_context [ - 1 ] . name_region . begin ( ) , "meta.function-call.support.createcomponent.cfml" , ) : r = utils . get_scope_region_containing_point ( cfml_view . view , dot_context [ - 1 ] . name_region . begin ( ) , "meta.function-call.support.createcomponent.cfml" , ) cfc_path = get_component_name ( cfml_view . view . substr ( r ) ) file_path , dot_path = get_cfc_file_info ( cfml_view , cfc_path ) return ( cfc_path , file_path , dot_path , function_name , [ r , funct_region ] , ) if is_possible_cfc_instance ( dot_context ) : cfc_path , file_path , dot_path , temp , regions = find_cfc_by_var_assignment ( cfml_view , position , dot_context [ 0 ] . name ) if regions : regions . append ( dot_context [ 0 ] . name_region ) regions . append ( funct_region ) return cfc_path , file_path , dot_path , function_name , regions if cfml_view . view . match_selector ( position , "variable.other, meta.property.cfml" ) : var_region = cfml_view . view . word ( position ) dot_context = cfml_view . get_dot_context ( var_region . begin ( ) - 1 ) if len ( dot_context ) == 0 or ( len ( dot_context ) == 1 and dot_context [ 0 ] . name == "variables" ) : cfc_path , file_path , dot_path , temp , regions = find_cfc_by_var_assignment ( cfml_view , position , cfml_view . view . substr ( var_region ) . lower ( ) ) if regions : regions . append ( var_region ) return cfc_path , file_path , dot_path , temp , regions return None , None , None , None , None