Search in sources :

Example 56 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class FlexCompletionTest method testResourceBundleFromSdk.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testResourceBundleFromSdk() throws Exception {
    final String testName = getTestName(false);
    final Sdk flexSdk = FlexUtils.getSdkForActiveBC(getModule());
    final SdkModificator sdkModificator = flexSdk.getSdkModificator();
    final VirtualFile swcFile = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + "/" + getBasePath() + "/" + testName + ".swc");
    sdkModificator.addRoot(JarFileSystem.getInstance().getJarRootForLocalFile(swcFile), OrderRootType.CLASSES);
    sdkModificator.commitChanges();
    doTest("", "as");
    doTest("", "mxml");
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) Sdk(com.intellij.openapi.projectRoots.Sdk) SdkModificator(com.intellij.openapi.projectRoots.SdkModificator) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 57 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class FlexOptimizeImportsTest method testNoBlankLines2.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testNoBlankLines2() throws Throwable {
    JSTestUtils.addClassesToProject(myFixture, true, "com.Foo", "com.Bar", "com.Zzz");
    final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject());
    XmlCodeStyleSettings xmlSettings = styleSettings.getCustomSettings(XmlCodeStyleSettings.class);
    boolean b = xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA;
    try {
        xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = true;
        runOptimizeAction(MXML_FILE_EXTENSION);
    } finally {
        xmlSettings.XML_KEEP_WHITE_SPACES_INSIDE_CDATA = b;
    }
}
Also used : JSCodeStyleSettings(com.intellij.lang.javascript.formatter.JSCodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) ECMA4CodeStyleSettings(com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings) CodeStyleSettings(com.intellij.psi.codeStyle.CodeStyleSettings) XmlCodeStyleSettings(com.intellij.psi.formatter.xml.XmlCodeStyleSettings) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 58 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class ResolveExternalInlineStyleSourceActionTest method testFindInnerComponentInDeclarations.

@JSTestOptions({ JSTestOption.WithGumboSdk, JSTestOption.WithFlexFacet })
public void testFindInnerComponentInDeclarations() throws Exception {
    Map<String, String> styles = new THashMap<>();
    styles.put("skinClass", "spark.skins.spark.ButtonBarMiddleButtonSkin");
    ResolveExternalInlineStyleSourceAction action = new ResolveExternalInlineStyleSourceAction("innerComponentInDeclarations", "spark.components.ButtonBarButton", "skinClass", styles, myModule);
    PsiElement element = (PsiElement) action.find();
    assertNotNull(element);
    assertEquals(1002, element.getTextOffset());
}
Also used : THashMap(gnu.trove.THashMap) PsiElement(com.intellij.psi.PsiElement) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 59 with JSTestOptions

use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.

the class ResolveExternalInlineStyleSourceActionTest method testFindInnerComponentInDeclarationsAsTag.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithJsSupportLoader, JSTestOption.WithGumboSdk, JSTestOption.WithFlexFacet })
public void testFindInnerComponentInDeclarationsAsTag() throws Exception {
    Map<String, String> styles = new THashMap<>();
    styles.put("skinClass", "spark.skins.spark.ButtonBarLastButtonSkin");
    ResolveExternalInlineStyleSourceAction action = new ResolveExternalInlineStyleSourceAction("innerComponentInDeclarations", "spark.components.ButtonBarButton", "skinClass", styles, myModule);
    PsiElement element = (PsiElement) action.find();
    assertNotNull(element);
    assertEquals(1323, element.getTextOffset());
}
Also used : THashMap(gnu.trove.THashMap) PsiElement(com.intellij.psi.PsiElement) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Aggregations

JSTestOptions (com.intellij.lang.javascript.JSTestOptions)59 VirtualFile (com.intellij.openapi.vfs.VirtualFile)20 PsiFile (com.intellij.psi.PsiFile)12 PsiElement (com.intellij.psi.PsiElement)11 JSExpressionCodeFragment (com.intellij.lang.javascript.psi.JSExpressionCodeFragment)5 File (java.io.File)5 CssDocumentationProvider (com.intellij.psi.css.impl.util.CssDocumentationProvider)4 THashMap (gnu.trove.THashMap)4 GutterMark (com.intellij.codeInsight.daemon.GutterMark)3 FlexDocumentationProvider (com.intellij.javascript.flex.FlexDocumentationProvider)3 DocumentationProvider (com.intellij.lang.documentation.DocumentationProvider)3 JSDocumentationProvider (com.intellij.lang.javascript.documentation.JSDocumentationProvider)3 JSCodeStyleSettings (com.intellij.lang.javascript.formatter.JSCodeStyleSettings)3 JSClass (com.intellij.lang.javascript.psi.ecmal4.JSClass)3 Sdk (com.intellij.openapi.projectRoots.Sdk)3 SdkModificator (com.intellij.openapi.projectRoots.SdkModificator)3 LookupElement (com.intellij.codeInsight.lookup.LookupElement)2 RunManager (com.intellij.execution.RunManager)2 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)2 ECMA4CodeStyleSettings (com.intellij.lang.javascript.formatter.ECMA4CodeStyleSettings)2