@Override
  public @NotNull Collection<PsiElement> getRoots(@NotNull PsiFile file) {
    if (!(file instanceof YAMLFile)) return ContainerUtil.emptyList();
    Collection<PsiElement> roots = new HashSet<>();
    for (YAMLDocument document : ((YAMLFile)file).getDocuments()) {
      YAMLValue topLevelValue = document.getTopLevelValue();
      roots.add(topLevelValue == null ? document : topLevelValue);
    }
    return roots;
  }
@Override
  public @NotNull Collection<PsiElement> getRoots(@NotNull PsiFile file)