private static void checkForCorrectContextElement(@NotNull List<PlaceInfo> placeInfos,
                                                    @NotNull PsiElement contextElement,
                                                    @NotNull Language language,
                                                    @NotNull PsiFile hostPsiFile,
                                                    @NotNull VirtualFile hostVirtualFile,
                                                    @NotNull DocumentEx hostDocument,
                                                    @NotNull PsiDocumentManagerBase documentManager) {
    boolean isAncestor = false;
    for (PlaceInfo info : placeInfos) {
      isAncestor |= PsiTreeUtil.isAncestor(contextElement, info.host, false);
    }
    assert isAncestor : exceptionContext("Context element " + contextElement.getTextRange() + ": '" + contextElement + "' (" + contextElement.getClass() + "); " +
                                         " must be the parent of at least one of injection hosts", language,
                                         hostPsiFile, hostVirtualFile, hostDocument, placeInfos, documentManager);
  }
private static void checkForCorrectContextElement(@NotNull List<PlaceInfo> placeInfos,
                                                    @NotNull PsiElement contextElement,
                                                    @NotNull Language language,
                                                    @NotNull PsiFile hostPsiFile,
                                                    @NotNull VirtualFile hostVirtualFile,
                                                    @NotNull DocumentEx hostDocument,
                                                    @NotNull PsiDocumentManagerBase documentManager)