Search in sources :

Example 1 with BlazeCWorkspace

use of com.google.idea.blaze.cpp.BlazeCWorkspace in project intellij by bazelbuild.

the class SyncStatusHelper method isUnsynced.

static boolean isUnsynced(Project project, VirtualFile virtualFile) {
    if (!virtualFile.isInLocalFileSystem()) {
        return false;
    }
    if (ProjectFileIndex.SERVICE.getInstance(project).getModuleForFile(virtualFile) == null) {
        return false;
    }
    OCWorkspace workspace = OCWorkspaceProvider.getWorkspace(project);
    if (!(workspace instanceof BlazeCWorkspace)) {
        // Skip if the project isn't a Blaze project or doesn't have C support enabled anyway.
        return false;
    }
    if (workspace.getConfigurations().isEmpty()) {
        // The workspace configurations may not have been loaded yet.
        return false;
    }
    SourceToTargetMap sourceToTargetMap = SourceToTargetMap.getInstance(project);
    return sourceToTargetMap.getRulesForSourceFile(VfsUtilCore.virtualToIoFile(virtualFile)).isEmpty();
}
Also used : SourceToTargetMap(com.google.idea.blaze.base.targetmaps.SourceToTargetMap) OCWorkspace(com.jetbrains.cidr.lang.workspace.OCWorkspace) BlazeCWorkspace(com.google.idea.blaze.cpp.BlazeCWorkspace)

Aggregations

SourceToTargetMap (com.google.idea.blaze.base.targetmaps.SourceToTargetMap)1 BlazeCWorkspace (com.google.idea.blaze.cpp.BlazeCWorkspace)1 OCWorkspace (com.jetbrains.cidr.lang.workspace.OCWorkspace)1