mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix root type detection for directory
This commit is contained in:
@@ -109,9 +109,9 @@ public class ScratchFileServiceImpl extends ScratchFileService implements Persis
|
||||
@Nullable
|
||||
@Override
|
||||
public RootType getRootType(@NotNull VirtualFile file) {
|
||||
VirtualFile parent = file.getParent();
|
||||
if (!(parent instanceof VirtualFileWithId)) return null;
|
||||
RootType result = myIndex.getInfoForFile(parent);
|
||||
VirtualFile directory = file.isDirectory() ? file : file.getParent();
|
||||
if (!(directory instanceof VirtualFileWithId)) return null;
|
||||
RootType result = myIndex.getInfoForFile(directory);
|
||||
return result == NULL_TYPE ? null : result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user