Search in sources :

Example 36 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testPackageNameCombo.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testPackageNameCombo() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    PsiFile fragment = JSReferenceEditor.forPackageName("", myProject, "", GlobalSearchScope.projectScope(myProject), "").getPsiFile();
    String[] included = new String[] { "com" };
    String[] excluded = new String[] { "public", "function", "while", "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher" };
    checkTextFieldCompletion((JSExpressionCodeFragment) fragment, included, excluded, "com", BASE_PATH + getTestName(false) + ".txt");
}
Also used : PsiFile(com.intellij.psi.PsiFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 37 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testCreateFlexSkinHostComponent.

@JSTestOptions({ JSTestOption.WithFlexFacet, JSTestOption.WithGumboSdk })
public void testCreateFlexSkinHostComponent() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    PsiFile fragment = CreateFlexSkinDialog.createHostComponentCombo("", myModule).getPsiFile();
    String[] included = new String[] { "Z111", "Z222" };
    // TODO primitive types (and e.g. not subclasses of SkinnableComponent?) should be removed from completion list
    String[] excluded = new String[] { "public", "function", "while", "Z333", "EventDispatcher", "int", "String", "uint", "Number" };
    checkTextFieldCompletion((JSExpressionCodeFragment) fragment, included, excluded, "Z111", BASE_PATH + getTestName(false) + ".txt");
}
Also used : PsiFile(com.intellij.psi.PsiFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 38 with JSTestOptions

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

the class FlexCompletionInUmlTextFieldsTest method testCreateUmlFieldInitializer.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testCreateUmlFieldInitializer() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    JSExpressionCodeFragment fragment = JSCreateFieldDialog.createInitializerCodeFragment(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 39 with JSTestOptions

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

the class FlexCompletionInUmlTextFieldsTest method testCreateUmlFieldType.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testCreateUmlFieldType() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    PsiFile fragment = JSCreateFieldDialog.createTypeField(myProject, JSCreateFieldDialog.getTypeFieldScope(myModule, myProject)).getPsiFile();
    String[] included = new String[] { "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher", "void", "*" };
    String[] excluded = ArrayUtil.mergeArrays(DEFALUT_VALUES, "public", "function", "while");
    checkTextFieldCompletion((JSExpressionCodeFragment) fragment, included, excluded, "Z111", BASE_PATH + getTestName(false) + ".txt");
}
Also used : PsiFile(com.intellij.psi.PsiFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 40 with JSTestOptions

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

the class FlexNavigationTest method testSdkClass2.

@JSTestOptions({ JSTestOption.WithFlexFacet })
public void testSdkClass2() 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)

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