Java 类com.intellij.lang.javascript.JavascriptLanguage 实例源码

项目:react-templates-plugin    文件:RTJSBracesUtil.java   
public static boolean hasConflicts(String start, String end, PsiElement element) {
    final Language elementLanguage = element.getLanguage();
    // JSP contains two roots that contain XmlText, don't inject anything in JSP root to prevent double injections
    if ("JSP".equals(elementLanguage.getDisplayName())) {
        return true;
    }

    PsiFile file = element.getContainingFile();
    if (DEFAULT_START.equals(start) || DEFAULT_END.equals(end)) {
        // JSX attributes don't contain AngularJS injections, {{}} is JSX injection with object inside
        if (elementLanguage.isKindOf(JavascriptLanguage.INSTANCE)) return true;

        for (Language language : file.getViewProvider().getLanguages()) {
            if (DEFAULT_CONFLICTS.contains(language.getDisplayName())) {
                return true;
            }
        }
    }
    return false;
}
项目:react-templates-plugin    文件:RTJSBracesUtil.java   
public static boolean hasConflicts(String start, String end, PsiElement element) {
    final Language elementLanguage = element.getLanguage();
    // JSP contains two roots that contain XmlText, don't inject anything in JSP root to prevent double injections
    if ("JSP".equals(elementLanguage.getDisplayName())) {
        return true;
    }

    PsiFile file = element.getContainingFile();
    if (DEFAULT_START.equals(start) || DEFAULT_END.equals(end)) {
        // JSX attributes don't contain AngularJS injections, {{}} is JSX injection with object inside
        if (elementLanguage.isKindOf(JavascriptLanguage.INSTANCE)) return true;

        for (Language language : file.getViewProvider().getLanguages()) {
            if (DEFAULT_CONFLICTS.contains(language.getDisplayName())) {
                return true;
            }
        }
    }
    return false;
}
项目:CommonJSAutoComplete    文件:LangUtil.java   
public static @NotNull JavascriptLanguage getJSLang () {
    Language js = Language.findLanguageByID(JS_ID);
    if (js == null) {
        return JavascriptLanguage.INSTANCE;
    }
    return (JavascriptLanguage) js;
}
项目:ouzo-phpstorm-plugin    文件:TranslationContentCreatorTest.java   
@Test
public void shouldBuildTranslationForJavascriptStringInJsFile() {
    //given
    when(typeResolver.isJsLiteral(psiElement)).thenReturn(true);
    when(typeResolver.getFileLanguage(psiElement)).thenReturn(JavascriptLanguage.INSTANCE);

    //when
    String content = contentCreator.buildTranslation("key", psiElement);

    //then
    assertEquals("t('key')", content);
}
项目:phpstorm-plugin-mediawiki    文件:MediaWikiJsPredefinedCodeStyle.java   
public MediaWikiJsPredefinedCodeStyle() {
    super("MediaWiki", JavascriptLanguage.INSTANCE);
}
项目:livescript-idea    文件:LiveScriptLanguage.java   
public LiveScriptLanguage() {
      super(JavascriptLanguage.INSTANCE, "LiveScript", new String[] { "text/ls" });
}