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; }
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; }
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; }
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()); } }
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; }
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()); }