use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.
the class BCUtils method getMainClassFilter.
public static PublicInheritorFilter getMainClassFilter(@NotNull Module module, @Nullable FlexBuildConfiguration bc, final boolean rlm, final boolean includeTests, boolean caching) {
final String baseClass = rlm ? FlashRunConfigurationForm.MODULE_BASE_CLASS_NAME : FlashRunConfigurationForm.SPRITE_CLASS_NAME;
final GlobalSearchScope filterScope = bc == null ? module.getModuleWithDependenciesAndLibrariesScope(includeTests) : FlexUtils.getModuleWithDependenciesAndLibrariesScope(module, bc, includeTests);
return new PublicInheritorFilter(module.getProject(), baseClass, filterScope, true, caching);
}
use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.
the class ActionScriptCompletionInTextFieldTest method doTestCustomScope.
private void doTestCustomScope(String activeBcName, String selectedBcName, int numberOfVariants) throws Exception {
String filename = getTestName(false).replaceAll("\\d+", "");
configureByFiles(null, BASE_PATH + filename + "_2.mxml", BASE_PATH + filename + "_3.mxml");
final Sdk sdk = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
FlexTestUtils.modifyConfigs(myProject, e -> {
{
final ModifiableFlexBuildConfiguration bc = e.getConfigurations(myModule)[0];
bc.setName("Flex");
bc.setNature(new BuildConfigurationNature(TargetPlatform.Web, false, OutputType.Application));
FlexTestUtils.setSdk(bc, sdk);
}
{
final ModifiableFlexBuildConfiguration bc = e.createConfiguration(myModule);
bc.setName("AIR");
bc.setNature(new BuildConfigurationNature(TargetPlatform.Desktop, false, OutputType.Application));
FlexTestUtils.setSdk(bc, sdk);
}
});
final FlexBuildConfigurationManager manager = FlexBuildConfigurationManager.getInstance(myModule);
manager.setActiveBuildConfiguration(manager.findConfigurationByName(activeBcName));
final ModuleWithDependenciesScope scope = FlexUtils.getModuleWithDependenciesAndLibrariesScope(myModule, manager.findConfigurationByName(selectedBcName), false);
PublicInheritorFilter filter = new PublicInheritorFilter(myProject, FlashRunConfigurationForm.SPRITE_CLASS_NAME, scope, true);
PsiFile fragment = JSReferenceEditor.forClassName("", myProject, null, GlobalSearchScope.moduleScope(myModule), null, filter, "").getPsiFile();
doTestForEditorTextField((JSExpressionCodeFragment) fragment, "", "js2", BASE_PATH + filename + ".txt");
if (numberOfVariants == 0) {
assertNull(myItems);
} else {
assertEquals(numberOfVariants, myItems.length);
}
}
use of com.intellij.lang.javascript.psi.impl.PublicInheritorFilter in project intellij-plugins by JetBrains.
the class CreateFlexSkinDialog method createHostComponentCombo.
public static JSReferenceEditor createHostComponentCombo(String text, Module module) {
final GlobalSearchScope scope = getHostComponentScope(module);
Condition<JSClass> filter = new PublicInheritorFilter(module.getProject(), SKINNABLE_COMPONENT_CLASS, scope, true);
return JSReferenceEditor.forClassName(text, module.getProject(), HOST_COMPONENT_RECENT_KEY, scope, null, filter, FlexBundle.message("choose.host.component"));
}
Aggregations