Language (Project project, VirtualFile file) { final PsiFile psiFile = file != null && file.isValid() ? PsiManager.getInstance(project).findFile(file) : null; if (psiFile != null) { for (Language language : psiFile.getViewProvider().getLanguages()) { if ((ContainerUtil.find(SUPPORTED_LANGUAGES, language::isKindOf) != null) && !(language instanceof TemplateLanguage) || XmlTypedHandlersAdditionalSupport.supportsTypedHandlers(psiFile, language)) { return language; } } } return null; }