Search in sources :

Example 1 with TemplateLanguage

use of com.intellij.psi.templateLanguages.TemplateLanguage in project intellij-community by JetBrains.

the class LanguageUtil method isInTemplateLanguageFile.

public static boolean isInTemplateLanguageFile(@Nullable final PsiElement element) {
    if (element == null)
        return false;
    final PsiFile psiFile = element.getContainingFile();
    if (psiFile == null)
        return false;
    final Language language = psiFile.getViewProvider().getBaseLanguage();
    return language instanceof TemplateLanguage;
}
Also used : TemplateLanguage(com.intellij.psi.templateLanguages.TemplateLanguage) PsiFile(com.intellij.psi.PsiFile) TemplateLanguage(com.intellij.psi.templateLanguages.TemplateLanguage)

Aggregations

PsiFile (com.intellij.psi.PsiFile)1 TemplateLanguage (com.intellij.psi.templateLanguages.TemplateLanguage)1