mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 19:02:13 +07:00
DBE: fix resolve settings for consoles DBE-4652
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user