src/JSUtils/ScopeManager.js
function addFilesToTern(files) {
            // limit the number of files added to tern.
            var maxFileCount = preferences.getMaxFileCount();
            if (numResolvedFiles + numAddedFiles < maxFileCount) {
                var available = maxFileCount - numResolvedFiles - numAddedFiles;

                if (available < files.length) {
                    files = files.slice(0, available);
                }

                numAddedFiles += files.length;
                ternPromise.done(function (ternModule) {
                    var msg = {
                        type        : MessageIds.TERN_ADD_FILES_MSG,
                        files       : files
                    };

                    if (config.debug) {
                        console.debug("Sending message", msg);
                    }
                    _ternNodeDomain.exec("invokeTernCommand", msg);
                });

            } else {
                stopAddingFiles = true;
            }

            return stopAddingFiles;
        }
function addFilesToTern(files) {
            // limit the number of files added to tern.
            var maxFileCount = preferences.getMaxFileCount();
            if (numResolvedFiles + numAddedFiles < maxFileCount) {
                var available = maxFileCount - numResolvedFiles - numAddedFiles;

                if (available < files.length) {
                    files = files.slice(0, available);
                }

                numAddedFiles += files.length;
                ternPromise.done(function (ternModule) {
                    var msg = {
                        type        : MessageIds.TERN_ADD_FILES_MSG,
                        files       : files
                    };

                    if (config.debug) {
                        console.debug("Sending message", msg);
                    }
                    _ternNodeDomain.exec("invokeTernCommand", msg);
                });

            } else {
                stopAddingFiles = true;
            }

            return stopAddingFiles;
        }
function addFilesToTern ( files ) { // limit the number of files added to tern. var maxFileCount = preferences . getMaxFileCount ( ) ; if ( numResolvedFiles + numAddedFiles < maxFileCount ) { var available = maxFileCount - numResolvedFiles - numAddedFiles ; if ( available < files . length ) { files = files . slice ( 0 , available ) ; } numAddedFiles += files . length ; ternPromise . done ( function ( ternModule ) { var msg = { type : MessageIds . TERN_ADD_FILES_MSG , files : files } ; if ( config . debug ) { console . debug ( "Sending message" , msg ) ; } _ternNodeDomain . exec ( "invokeTernCommand" , msg ) ; } ) ; } else { stopAddingFiles = true ; } return stopAddingFiles ; }
Add new files to tern, keeping any previous files.
The tern server must be initialized before making
this call.

@param {Array.<string>} files - array of file to add to tern.
@return {boolean} - true if more files may be added, false if maximum has been reached.
Add new files to tern keeping any previous files . The tern server must be initialized before making this call .