LanguageFileType (@NotNull PsiElement context) { final PsiFile file = context instanceof PsiFile ? (PsiFile)context : context.getContainingFile(); final Language contextLanguage = context instanceof PsiFile ? null : context.getLanguage(); if (file.getLanguage() == HTMLLanguage.INSTANCE || (file.getFileType().getName().equals("JSP") && contextLanguage == HTMLLanguage.INSTANCE)) { return HtmlFileType.INSTANCE; } return XmlFileType.INSTANCE; }