Java 类com.intellij.psi.templateLanguages.TemplateLanguage 实例源码

项目:intellij-ce-playground    文件:LanguageUtil.java   
public static boolean isInjectableLanguage(@NotNull Language language) {
  if (language == Language.ANY) {
    return false;
  }
  if (language.getID().startsWith("$")) {
    return false;
  }
  if (language instanceof InjectableLanguage) {
    return true;
  }
  if (language instanceof TemplateLanguage || language instanceof DependentLanguage) {
    return false;
  }
  if (LanguageParserDefinitions.INSTANCE.forLanguage(language) == null) {
    return false;
  }
  return true;
}
项目:tools-idea    文件:LanguageUtil.java   
public static boolean isInjectableLanguage(Language language) {
  if (language == Language.ANY) {
    return false;
  }
  if (language.getID().startsWith("$")) {
    return false;
  }
  if (language instanceof InjectableLanguage) {
    return true;
  }
  if (language instanceof TemplateLanguage || language instanceof DependentLanguage) {
    return false;
  }
  if (LanguageParserDefinitions.INSTANCE.forLanguage(language) == null) {
    return false;
  }
  return true;
}
项目:consulo    文件:LanguageUtil.java   
public static boolean isInjectableLanguage(@Nonnull Language language) {
  if (language == Language.ANY) {
    return false;
  }
  if (language.getID().startsWith("$")) {
    return false;
  }
  if (language instanceof InjectableLanguage) {
    return true;
  }
  if (language instanceof TemplateLanguage) {
    return false;
  }
  if (LanguageParserDefinitions.INSTANCE.forLanguage(language) == null) {
    return false;
  }
  return true;
}
项目:GoJetPlugin    文件:JetFileViewProvider.java   
public JetFileViewProvider(PsiManager manager, VirtualFile file, boolean physical) {
    super(manager, file, physical);

    Language dataLang = TemplateDataLanguageMappings.getInstance(manager.getProject()).getMapping(file);
    if (dataLang == null) dataLang = StdFileTypes.HTML.getLanguage();

    if (dataLang instanceof TemplateLanguage) {
        myTemplateDataLanguage = PlainTextLanguage.INSTANCE;
    } else {
        myTemplateDataLanguage = LanguageSubstitutors.INSTANCE.substituteLanguage(dataLang, file, manager.getProject());
    }
}
项目:intellij-ce-playground    文件:LanguageUtil.java   
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;
}
项目:tools-idea    文件:LanguageUtil.java   
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;
}
项目:consulo    文件:LanguageUtil.java   
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;
}
项目:consulo-apache-velocity    文件:VtlFileViewProvider.java   
public VtlFileViewProvider(final PsiManager manager, final VirtualFile virtualFile, final boolean physical) {
    super(manager, virtualFile, physical);
    final Language language = getTemplateDataLanguage(virtualFile, manager.getProject());
    myTemplateDataLanguage = language instanceof TemplateLanguage ? PlainTextLanguage.INSTANCE : LanguageSubstitutors.INSTANCE.substituteLanguage(language, virtualFile, manager.getProject());
}