src/language/JSUtils.js
function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
        var result  = new $.Deferred(),
            jsFiles = [];

        if (!keepAllFiles) {
            // Filter fileInfos for .js files
            jsFiles = fileInfos.filter(function (fileInfo) {
                return FileUtils.getFileExtension(fileInfo.fullPath).toLowerCase() === "js";
            });
        } else {
            jsFiles = fileInfos;
        }

        // RegExp search (or cache lookup) for all functions in the project
        _getFunctionsInFiles(jsFiles).done(function (docEntries) {
            // Compute offsets for all matched functions
            _getOffsetsForFunction(docEntries, functionName).done(function (rangeResults) {
                result.resolve(rangeResults);
            });
        });

        return result.promise();
    }
function findMatchingFunctions(functionName, fileInfos, keepAllFiles) {
        var result  = new $.Deferred(),
            jsFiles = [];

        if (!keepAllFiles) {
            // Filter fileInfos for .js files
            jsFiles = fileInfos.filter(function (fileInfo) {
                return FileUtils.getFileExtension(fileInfo.fullPath).toLowerCase() === "js";
            });
        } else {
            jsFiles = fileInfos;
        }

        // RegExp search (or cache lookup) for all functions in the project
        _getFunctionsInFiles(jsFiles).done(function (docEntries) {
            // Compute offsets for all matched functions
            _getOffsetsForFunction(docEntries, functionName).done(function (rangeResults) {
                result.resolve(rangeResults);
            });
        });

        return result.promise();
    }
function findMatchingFunctions ( functionName , fileInfos , keepAllFiles ) { var result = new $ . Deferred ( ) , jsFiles = [ ] ; if ( ! keepAllFiles ) { // Filter fileInfos for .js files jsFiles = fileInfos . filter ( function ( fileInfo ) { return FileUtils . getFileExtension ( fileInfo . fullPath ) . toLowerCase ( ) === "js" ; } ) ; } else { jsFiles = fileInfos ; } // RegExp search (or cache lookup) for all functions in the project _getFunctionsInFiles ( jsFiles ) . done ( function ( docEntries ) { // Compute offsets for all matched functions _getOffsetsForFunction ( docEntries , functionName ) . done ( function ( rangeResults ) { result . resolve ( rangeResults ) ; } ) ; } ) ; return result . promise ( ) ; }
Return all functions that have the specified name, searching across all the given files.

@param {!String} functionName The name to match.
@param {!Array.<File>} fileInfos The array of files to search.
@param {boolean=} keepAllFiles If true, don't ignore non-javascript files.
@return {$.Promise} that will be resolved with an Array of objects containing the
source document, start line, and end line (0-based, inclusive range) for each matching function list.
Does not addRef() the documents returned in the array.
Return all functions that have the specified name searching across all the given files .