@Override
  public @Nullable RootType getRootType(@Nullable VirtualFile file) {
    if (file == null || !file.isInLocalFileSystem()) {
      return null;
    }

    VirtualFile directory = file.isDirectory() ? file : file.getParent();
    RootType result = myIndex.getInfoForFile(directory);
    return result == NO_ROOT_TYPE ? null : result;
  }
@Override
  public @Nullable RootType getRootType(@Nullable VirtualFile file)