static boolean shouldDelegateToTopLevel(Document document, @NotNull PsiFile file) {
    return document instanceof DocumentWindow && shouldDelegateToTopLevel(file);
  }
static boolean shouldDelegateToTopLevel(Document document, @NotNull PsiFile file)