Search in sources :

Example 6 with JSTestOptions

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

the class FlexDocumentationTest method testFlexCssProperty.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexCssProperty() throws Exception {
    DocumentationProvider cssDocumentationProvider = new CssDocumentationProvider();
    PsiElement docElement = getDocElementForLookupItem(cssDocumentationProvider, getTestName(false) + ".css");
    assertInstanceOf(docElement, JSAttributeNameValuePair.class);
}
Also used : PsiElement(com.intellij.psi.PsiElement) CssDocumentationProvider(com.intellij.psi.css.impl.util.CssDocumentationProvider) FlexDocumentationProvider(com.intellij.javascript.flex.FlexDocumentationProvider) DocumentationProvider(com.intellij.lang.documentation.DocumentationProvider) JSDocumentationProvider(com.intellij.lang.javascript.documentation.JSDocumentationProvider) CssDocumentationProvider(com.intellij.psi.css.impl.util.CssDocumentationProvider) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 7 with JSTestOptions

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

the class FlexDocumentationTest method testFlexCssPropertyMultiDocumentationInLookup.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testFlexCssPropertyMultiDocumentationInLookup() throws Exception {
    DocumentationProvider cssDocProvider = new CssDocumentationProvider();
    String doc = testOne(cssDocProvider, getTestName(false) + ".css", new CssPropertyDescriptorStub("borderColor"));
    assertNotNull(doc);
    assertTrue("Container's borderColor property missing", doc.indexOf("Container") >= 0);
    assertTrue("Button's borderColor property missing", doc.indexOf("Button") >= 0);
    assertTrue("UIComponent's borderColor property missing", doc.indexOf("UIComponent") >= 0);
}
Also used : CssPropertyDescriptorStub(com.intellij.psi.css.descriptor.CssPropertyDescriptorStub) CssDocumentationProvider(com.intellij.psi.css.impl.util.CssDocumentationProvider) FlexDocumentationProvider(com.intellij.javascript.flex.FlexDocumentationProvider) DocumentationProvider(com.intellij.lang.documentation.DocumentationProvider) JSDocumentationProvider(com.intellij.lang.javascript.documentation.JSDocumentationProvider) CssDocumentationProvider(com.intellij.psi.css.impl.util.CssDocumentationProvider) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 8 with JSTestOptions

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

the class FlexNavigationTest method testSdkClass1.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testSdkClass1() throws Exception {
    VirtualFile asdoc = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + BASE_PATH + "SdkAsdoc.zip");
    asdoc = JarFileSystem.getInstance().getJarRootForLocalFile(asdoc);
    VirtualFile swc = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + BASE_PATH + "CustomSdk.swc");
    swc = JarFileSystem.getInstance().getJarRootForLocalFile(swc);
    FlexTestUtils.setupCustomSdk(myModule, swc, null, asdoc);
    myAfterCommitRunnable = () -> FlexTestUtils.addLibrary(myModule, "Lib", getTestDataPath() + BASE_PATH, "TestLib1.swc", null, null);
    VirtualFile forAsDoc = swc.findChild("library.swf");
    doTest("SdkClass.as", null, forAsDoc);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 9 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testChangeSignatureDefaultValueCell.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testChangeSignatureDefaultValueCell() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    JSExpressionCodeFragment fragment = JSParameterTableModel.createDefaultValueCellFragment("", createFakeClass());
    String[] included = DEFALUT_VALUES;
    // TODO classes should be removed from completion list
    included = ArrayUtil.mergeArrays(included, "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher");
    String[] excluded = new String[] { "public", "function", "while" };
    checkTextFieldCompletion(fragment, included, excluded, "EventDispatcher", BASE_PATH + getTestName(false) + ".txt");
}
Also used : JSExpressionCodeFragment(com.intellij.lang.javascript.psi.JSExpressionCodeFragment) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 10 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testMoveMembersTargetInnerClass.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testMoveMembersTargetInnerClass() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    PsiFile fragment = ActionScriptMoveMembersDialog.createTargetClassField(myProject, "", ActionScriptMoveMembersDialog.getScope(myProject), myFile).getPsiFile();
    String[] included = new String[] { "Inner" };
    checkTextFieldCompletion((JSExpressionCodeFragment) fragment, included, ArrayUtil.EMPTY_STRING_ARRAY, "Inner", BASE_PATH + getTestName(false) + ".txt");
}
Also used : PsiFile(com.intellij.psi.PsiFile) 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