Search in sources :

Example 11 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testChangeSignatureInitializerCell.

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

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

the class FlexNavigationTest method testLibraryClass3.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testLibraryClass3() throws Exception {
    myAfterCommitRunnable = () -> FlexTestUtils.addLibrary(myModule, "Lib", getTestDataPath() + BASE_PATH, "TestLib1.swc", null, null);
    final VirtualFile forSource = getFile("TestLib1.swc!/library.swf");
    doTest("LibraryClass.as", forSource, forSource);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 13 with JSTestOptions

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

the class FlexNavigationTest method testLibraryClass1.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testLibraryClass1() throws Exception {
    final String sources = "TestLibSources.zip";
    myAfterCommitRunnable = () -> {
        FlexTestUtils.addLibrary(myModule, "Lib", getTestDataPath() + BASE_PATH, "TestLib1.swc", null, null);
        FlexTestUtils.addLibrary(myModule, "LibWithSources", getTestDataPath() + BASE_PATH, "TestLib2.swc", sources, null);
        FlexTestUtils.addLibrary(myModule, "LibWithAsdoc", getTestDataPath() + BASE_PATH, "TestLib3.swc", null, "TestLibAsdoc.zip");
    };
    final VirtualFile forSource = getFile(sources + "!/com/test/MyButton.as");
    doTest("LibraryClass.as", forSource, forSource);
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 14 with JSTestOptions

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

the class FlexNavigationTest method testAmbiguousCssSelector.

@JSTestOptions({ JSTestOption.WithCssSupportLoader, JSTestOption.WithFlexFacet })
public void testAmbiguousCssSelector() throws Exception {
    final String sources = "StyleableLibSources.zip";
    myAfterCommitRunnable = () -> {
        FlexTestUtils.addLibrary(myModule, "Lib1", getTestDataPath() + BASE_PATH, "StyleableLib.swc", sources, null);
        FlexTestUtils.addLibrary(myModule, "Lib2", getTestDataPath() + BASE_PATH, "StyleableLib1.swc", null, null);
    };
    final VirtualFile styleableFile = getFile(sources + "!/foo/Styleable1.as");
    doTest(getTestName(false) + ".css", styleableFile, null);
    PsiFile file = PsiManager.getInstance(myProject).findFile(styleableFile);
    if (file instanceof PsiFileImpl) {
        assertNull("File should not be parsed", ((PsiFileImpl) file).getTreeElement());
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) PsiFileImpl(com.intellij.psi.impl.source.PsiFileImpl) JSTestOptions(com.intellij.lang.javascript.JSTestOptions)

Example 15 with JSTestOptions

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

the class ActionScriptCompletionInTextFieldTest method testChangeSignatureParameterTypeCell.

@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testChangeSignatureParameterTypeCell() throws Exception {
    configureByFiles(null, BASE_PATH + getTestName(false) + "_2.js2");
    JSExpressionCodeFragment fragment = JSParameterTableModel.createParameterTypeCellFragment("", myProject);
    String[] included = new String[] { "Z111", "Z222", "int", "String", "uint", "Number", "EventDispatcher", "void", "*" };
    String[] excluded = ArrayUtil.mergeArrays(DEFALUT_VALUES, "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)

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