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();
}
Aggregations