DBE: fix resolve settings for consoles DBE-4652

This commit is contained in:
Alexander Kass
2017-05-30 10:34:53 +03:00
parent 6dc53d5633
commit 0a69dfd5f4
@@ -107,16 +107,20 @@ public abstract class PerFileMappingsBase<T> implements PersistentStateComponent
if (t != null) return t;
t = getMappingForHierarchy(originalFile, mappings);
if (t != null) return t;
Project project = getProject();
if (project == null || file == null ||
file.getFileSystem() instanceof NonPhysicalFileSystem ||
ProjectFileIndex.getInstance(project).isInContent(file)) {
return mappings.get(null);
}
return null;
return getNotInHierarchy(file, mappings);
}
}
@Nullable
protected T getNotInHierarchy(@Nullable VirtualFile file, @NotNull Map<VirtualFile, T> mappings) {
if (getProject() == null || file == null ||
file.getFileSystem() instanceof NonPhysicalFileSystem ||
ProjectFileIndex.getInstance(getProject()).isInContent(file)) {
return mappings.get(null);
}
return null;
}
private static <T> T getMappingForHierarchy(@Nullable VirtualFile file, @NotNull Map<VirtualFile, T> mappings) {
for (VirtualFile cur = file; cur != null; cur = cur.getParent()) {
T t = mappings.get(cur);