use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class ActionScriptResolveTest method testResolve26.
@JSTestOptions({ JSTestOption.WithIndex })
public void testResolve26() throws Exception {
String fileText = "dynamic class Object {}\n" + "package {\n" + "\timport flash.display.Sprite;\n" + "\tpublic class DoubleInterfaceResolve extends Sprite {\n" + "\t}\n" + "}\n" + "import flash.display.Sprite;\n" + "class FooView extends Sprite {\n" + "}\n" + "\n" + "interface ItfA {\n" + " function f():It<ref>fB;\n" + "}\n" + "interface ItfB {}";
PsiReference ref = configureByFileText(fileText, "sample.js2");
PsiElement resolved = ref.resolve();
assertTrue(resolved instanceof JSClass);
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class SwfHighlightingTest method testLineMarkersInSwf.
@JSTestOptions({ JSTestOption.WithFlexFacet, JSTestOption.WithLineMarkers })
public void testLineMarkersInSwf() throws Exception {
final String testName = getTestName(false);
myAfterCommitRunnable = () -> FlexTestUtils.addLibrary(myModule, "lib", getTestDataPath() + getBasePath() + "/", testName + ".swc", null, null);
// actual test data is in library.swf; this file is here just because we need any file
configureByFile("/" + testName + ".as");
VirtualFile vFile = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + getBasePath() + "/" + testName + ".swc");
vFile = JarFileSystem.getInstance().getJarRootForLocalFile(vFile).findChild("library.swf");
myEditor = FileEditorManager.getInstance(myProject).openTextEditor(new OpenFileDescriptor(myProject, vFile, 0), false);
PsiDocumentManager.getInstance(getProject()).commitAllDocuments();
myFile = myPsiManager.findFile(vFile);
((EditorImpl) myEditor).setCaretActive();
vFile = LocalFileSystem.getInstance().findFileByPath(getTestDataPath() + getBasePath() + "/" + testName + ".as");
final String verificationText = StreamUtil.convertSeparators(VfsUtilCore.loadText(vFile));
checkHighlighting(new ExpectedHighlightingData(new DocumentImpl(verificationText), false, false, true, myFile));
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexAutoImportsTest method testWrapImportStatement.
@JSTestOptions({ JSTestOption.WithFlexSdk })
public void testWrapImportStatement() throws Throwable {
CodeStyleSettings currentSettings = CodeStyleSettingsManager.getSettings(myFixture.getProject());
int m = currentSettings.getDefaultRightMargin();
currentSettings.setDefaultRightMargin(20);
try {
JSTestUtils.addClassesToProject(myFixture, true, "wwwwww.wwwwwwwwwwwww.wwwwwwwww.Wwwwwwwwwwwwwwwwwwww");
launchImportIntention(AS_FILE_EXTENSION, "wwwwww.wwwwwwwwwwwww.wwwwwwwww.Wwwwwwwwwwwwwwwwwwww");
} finally {
currentSettings.setDefaultRightMargin(m);
}
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexOptimizeImportsTest method testAmbiguous3.
@JSTestOptions({ JSTestOption.WithJsSupportLoader, JSTestOption.WithFlexSdk })
public void testAmbiguous3() throws Throwable {
final CodeStyleSettings styleSettings = CodeStyleSettingsManager.getSettings(getProject());
XmlCodeStyleSettings xmlSettings = styleSettings.getCustomSettings(XmlCodeStyleSettings.class);
int aroundCDataBefore = xmlSettings.XML_WHITE_SPACE_AROUND_CDATA;
xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = XmlCodeStyleSettings.WS_AROUND_CDATA_NEW_LINES;
JSTestUtils.addClassesToProject(myFixture, true, "com.a.ClassB", "com.b.ClassB");
runOptimizeAction(MXML_FILE_EXTENSION);
xmlSettings.XML_WHITE_SPACE_AROUND_CDATA = aroundCDataBefore;
}
use of com.intellij.lang.javascript.JSTestOptions in project intellij-plugins by JetBrains.
the class FlexOptimizeImportsTest method testNoSemicolons.
@JSTestOptions({ JSTestOption.WithJsSupportLoader, JSTestOption.WithFlexSdk })
public void testNoSemicolons() throws Throwable {
JSTestUtils.addClassesToProject(myFixture, true, "foo.MyClass", "foo.MyClass2", "bar.MyClass3");
final JSCodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getInstance(myFixture.getProject()).getCurrentSettings().getCustomSettings(ECMA4CodeStyleSettings.class);
boolean b = codeStyleSettings.USE_SEMICOLON_AFTER_STATEMENT;
codeStyleSettings.USE_SEMICOLON_AFTER_STATEMENT = false;
try {
runOptimizeAction(AS_FILE_EXTENSION);
} finally {
codeStyleSettings.USE_SEMICOLON_AFTER_STATEMENT = b;
}
}
Aggregations