src/search/node/FindInFilesDomain.js
function addFilesToCache(updateObject) {
    var fileList = updateObject.fileList || [],
        filesInSearchScope = updateObject.filesInSearchScope || [],
        i = 0,
        changedFilesAlreadyInList = [],
        newFiles = [];
    for (i = 0; i < fileList.length; i++) {
        // We just add a null entry indicating the precense of the file in the project list.
        // The file will be later read when required.
        projectCache[fileList[i]] = null;
    }

    //Now update the search scope
    function isInChangedFileList(path) {
        return (filesInSearchScope.indexOf(path) !== -1) ? true : false;
    }
    changedFilesAlreadyInList = files ? files.filter(isInChangedFileList) : [];
    function isNotAlreadyInList(path) {
        return (changedFilesAlreadyInList.indexOf(path) === -1) ? true : false;
    }
    newFiles = changedFilesAlreadyInList.filter(isNotAlreadyInList);
    files.push.apply(files, newFiles);
}
function addFilesToCache(updateObject) {
    var fileList = updateObject.fileList || [],
        filesInSearchScope = updateObject.filesInSearchScope || [],
        i = 0,
        changedFilesAlreadyInList = [],
        newFiles = [];
    for (i = 0; i < fileList.length; i++) {
        // We just add a null entry indicating the precense of the file in the project list.
        // The file will be later read when required.
        projectCache[fileList[i]] = null;
    }

    //Now update the search scope
    function isInChangedFileList(path) {
        return (filesInSearchScope.indexOf(path) !== -1) ? true : false;
    }
    changedFilesAlreadyInList = files ? files.filter(isInChangedFileList) : [];
    function isNotAlreadyInList(path) {
        return (changedFilesAlreadyInList.indexOf(path) === -1) ? true : false;
    }
    newFiles = changedFilesAlreadyInList.filter(isNotAlreadyInList);
    files.push.apply(files, newFiles);
}
function addFilesToCache ( updateObject ) { var fileList = updateObject . fileList || [ ] , filesInSearchScope = updateObject . filesInSearchScope || [ ] , i = 0 , changedFilesAlreadyInList = [ ] , newFiles = [ ] ; for ( i = 0 ; i < fileList . length ; i ++ ) { // We just add a null entry indicating the precense of the file in the project list. // The file will be later read when required. projectCache [ fileList [ i ] ] = null ; } //Now update the search scope function isInChangedFileList ( path ) { return ( filesInSearchScope . indexOf ( path ) !== - 1 ) ? true : false ; } changedFilesAlreadyInList = files ? files . filter ( isInChangedFileList ) : [ ] ; function isNotAlreadyInList ( path ) { return ( changedFilesAlreadyInList . indexOf ( path ) === - 1 ) ? true : false ; } newFiles = changedFilesAlreadyInList . filter ( isNotAlreadyInList ) ; files . push . apply ( files , newFiles ) ; }
Adds the list of given files to the project cache. However the files will not be
read at this time. We just delete the project cache entry which will trigger a fetch on search.
@param   {Object}   updateObject
Adds the list of given files to the project cache . However the files will not be read at this time . We just delete the project cache entry which will trigger a fetch on search .