boolean (@NotNull XmlElement holder) { Boolean doNotValidate = DO_NOT_VALIDATE.get(holder); if (doNotValidate != null) return doNotValidate; OuterLanguageElement element = PsiTreeUtil.getChildOfType(holder, OuterLanguageElement.class); if (element == null) { // JspOuterLanguageElement is located under XmlText for (PsiElement child = holder.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof XmlText) { element = PsiTreeUtil.getChildOfType(child, OuterLanguageElement.class); if (element != null) { break; } } } } if (element == null) { doNotValidate = false; } else { PsiFile containingFile = holder.getContainingFile(); doNotValidate = containingFile.getViewProvider().getBaseLanguage() != containingFile.getLanguage(); } holder.putUserData(DO_NOT_VALIDATE, doNotValidate); return doNotValidate; }