mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 17:03:12 +07:00
module content search scopes
This commit is contained in:
@@ -124,6 +124,9 @@ public interface Module extends ComponentManager, AreaInstance, Disposable {
|
||||
*/
|
||||
GlobalSearchScope getModuleWithDependenciesScope();
|
||||
|
||||
GlobalSearchScope getModuleContentScope();
|
||||
GlobalSearchScope getModuleContentWithDependenciesScope();
|
||||
|
||||
GlobalSearchScope getModuleWithDependenciesAndLibrariesScope(boolean includeTests);
|
||||
GlobalSearchScope getModuleWithDependentsScope();
|
||||
GlobalSearchScope getModuleTestsWithDependentsScope();
|
||||
|
||||
@@ -253,6 +253,16 @@ public class ModuleImpl extends ComponentManagerImpl implements Module {
|
||||
return getCachedScope(ModuleWithDependenciesScope.COMPILE | ModuleWithDependenciesScope.TESTS | ModuleWithDependenciesScope.MODULES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getModuleContentScope() {
|
||||
return getCachedScope(ModuleWithDependenciesScope.CONTENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getModuleContentWithDependenciesScope() {
|
||||
return getCachedScope(ModuleWithDependenciesScope.CONTENT | ModuleWithDependenciesScope.MODULES);
|
||||
}
|
||||
|
||||
public GlobalSearchScope getModuleWithDependenciesAndLibrariesScope(boolean includeTests) {
|
||||
return getCachedScope(ModuleWithDependenciesScope.COMPILE |
|
||||
ModuleWithDependenciesScope.MODULES |
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MockModule extends MockComponentManager implements Module {
|
||||
this(null, parentDisposable);
|
||||
}
|
||||
|
||||
public MockModule(final Project project, @NotNull Disposable parentDisposable) {
|
||||
public MockModule(@Nullable final Project project, @NotNull Disposable parentDisposable) {
|
||||
super(project == null ? null : project.getPicoContainer(), parentDisposable);
|
||||
myProject = project;
|
||||
}
|
||||
@@ -69,6 +69,16 @@ public class MockModule extends MockComponentManager implements Module {
|
||||
return new MockGlobalSearchScope();
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getModuleContentWithDependenciesScope() {
|
||||
throw new UnsupportedOperationException("Method getModuleContentWithDependenciesScope is not yet implemented in " + getClass().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getModuleContentScope() {
|
||||
throw new UnsupportedOperationException("Method getModuleContentScope is not yet implemented in " + getClass().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getModuleWithDependentsScope() {
|
||||
throw new UnsupportedOperationException("Method getModuleWithDependentsScope is not yet implemented in " + getClass().getName());
|
||||
|
||||
@@ -25,8 +25,6 @@ import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.module.ModuleUtil;
|
||||
import com.intellij.openapi.module.impl.ModuleImpl;
|
||||
import com.intellij.openapi.module.impl.scopes.ModuleWithDependenciesScope;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
@@ -87,7 +85,7 @@ class RegisterInspectionFix implements IntentionAction {
|
||||
Module module = ModuleUtil.findModuleForPsiElement(file);
|
||||
assert module != null;
|
||||
List<DomFileElement<IdeaPlugin>> elements =
|
||||
DomService.getInstance().getFileElements(IdeaPlugin.class, project, ((ModuleImpl)module).getCachedScope(ModuleWithDependenciesScope.CONTENT | ModuleWithDependenciesScope.MODULES));
|
||||
DomService.getInstance().getFileElements(IdeaPlugin.class, project, module.getModuleContentWithDependenciesScope());
|
||||
|
||||
elements = ContainerUtil.filter(elements, new Condition<DomFileElement<IdeaPlugin>>() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user