function syncFileIndex() {

        // TODO (issue 330) - allow multiple calls to syncFileIndex to be batched up so that this code isn't necessary
        if (_syncFileIndexReentracyGuard) {
            throw new Error("syncFileIndex cannot be called Recursively");
        }

        _syncFileIndexReentracyGuard = true;

        var rootDir = ProjectManager.getProjectRoot();
        if (_indexListDirty) {
            PerfUtils.markStart(PerfUtils.FILE_INDEX_MANAGER_SYNC);

            _clearIndexes();

            return _scanDirectorySubTree(rootDir)
                .done(function () {
                    PerfUtils.addMeasurement(PerfUtils.FILE_INDEX_MANAGER_SYNC);
                    _indexListDirty = false;
                    _syncFileIndexReentracyGuard = false;

                    //_logFileList(_indexList["all"].fileInfos);
                    //_logFileList(_indexList["css"].fileInfos);
                });
        } else {
            _syncFileIndexReentracyGuard = false;
            return $.Deferred().resolve().promise();
        }
    }
Clears and rebuilds all of the fileIndexes and sets _indexListDirty to false
@return {$.Promise} resolved when index has been updated