Search in sources :

Example 1 with ProjectScopeBuilderImpl

use of com.intellij.psi.search.ProjectScopeBuilderImpl in project intellij by bazelbuild.

the class BlazeRenderErrorContributorTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    super.initTest(applicationServices, projectServices);
    applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
    projectServices.register(ProjectFileIndex.class, mock(ProjectFileIndex.class));
    projectServices.register(BuildReferenceManager.class, new MockBuildReferenceManager(project));
    projectServices.register(TransitiveDependencyMap.class, new TransitiveDependencyMap(project));
    projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
    projectServices.register(AndroidResourceModuleRegistry.class, new AndroidResourceModuleRegistry());
    BlazeImportSettingsManager importSettingsManager = new BlazeImportSettingsManager();
    BlazeImportSettings settings = new BlazeImportSettings("", "", "", "", BuildSystem.Blaze);
    importSettingsManager.setImportSettings(settings);
    projectServices.register(BlazeImportSettingsManager.class, importSettingsManager);
    createPsiClassesAndSourceToTargetMap(projectServices);
    projectDataManager = new MockBlazeProjectDataManager();
    projectServices.register(BlazeProjectDataManager.class, projectDataManager);
    ExtensionPoint<RenderErrorContributor.Provider> extensionPoint = registerExtensionPoint(ExtensionPointName.create("com.android.rendering.renderErrorContributor"), RenderErrorContributor.Provider.class);
    extensionPoint.registerExtension(new RenderErrorContributor.Provider());
    extensionPoint.registerExtension(new BlazeRenderErrorContributor.BlazeProvider());
    module = new MockModule(project, () -> {
    });
    // For the isApplicable tests.
    provider = new BlazeRenderErrorContributor.BlazeProvider();
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) RenderErrorContributor(com.android.tools.idea.rendering.RenderErrorContributor) AndroidResourceModuleRegistry(com.google.idea.blaze.android.sync.model.AndroidResourceModuleRegistry) MockFileTypeManager(com.intellij.openapi.fileTypes.MockFileTypeManager) TransitiveDependencyMap(com.google.idea.blaze.base.targetmaps.TransitiveDependencyMap) MockModule(com.intellij.mock.MockModule) ProjectFileIndex(com.intellij.openapi.roots.ProjectFileIndex) ProjectScopeBuilderImpl(com.intellij.psi.search.ProjectScopeBuilderImpl)

Example 2 with ProjectScopeBuilderImpl

use of com.intellij.psi.search.ProjectScopeBuilderImpl in project intellij by bazelbuild.

the class BlazeAndroidModelTest method initTest.

@Override
protected void initTest(Container applicationServices, Container projectServices) {
    applicationServices.register(FileTypeManager.class, new MockFileTypeManager());
    applicationServices.register(FileDocumentManager.class, new MockFileDocumentManagerImpl(null, null));
    applicationServices.register(VirtualFileManager.class, mock(VirtualFileManager.class));
    applicationServices.register(BlazeBuildService.class, new BlazeBuildService());
    projectServices.register(ProjectScopeBuilder.class, new ProjectScopeBuilderImpl(project));
    projectServices.register(ProjectViewManager.class, new MockProjectViewManager());
    projectServices.register(BlazeProjectDataManager.class, new BlazeProjectDataManagerImpl(project));
    BlazeImportSettingsManager manager = new BlazeImportSettingsManager();
    manager.setImportSettings(new BlazeImportSettings("", "", "", "", BuildSystem.Blaze));
    projectServices.register(BlazeImportSettingsManager.class, manager);
    facade = new MockJavaPsiFacade(project, new MockPsiManager(project), ImmutableList.of("com.google.example.Modified", "com.google.example.NotModified"));
    projectServices.register(JavaPsiFacade.class, facade);
    module = new MockModule(() -> {
    });
    model = new BlazeAndroidModel(project, module, null, mock(SourceProvider.class), null, "", 0);
}
Also used : BlazeImportSettingsManager(com.google.idea.blaze.base.settings.BlazeImportSettingsManager) MockFileDocumentManagerImpl(com.intellij.mock.MockFileDocumentManagerImpl) BlazeImportSettings(com.google.idea.blaze.base.settings.BlazeImportSettings) VirtualFileManager(com.intellij.openapi.vfs.VirtualFileManager) BlazeProjectDataManagerImpl(com.google.idea.blaze.base.sync.data.BlazeProjectDataManagerImpl) MockFileTypeManager(com.intellij.openapi.fileTypes.MockFileTypeManager) MockPsiManager(com.intellij.mock.MockPsiManager) MockModule(com.intellij.mock.MockModule) BlazeBuildService(com.google.idea.blaze.base.actions.BlazeBuildService) ProjectScopeBuilderImpl(com.intellij.psi.search.ProjectScopeBuilderImpl)

Aggregations

BlazeImportSettings (com.google.idea.blaze.base.settings.BlazeImportSettings)2 BlazeImportSettingsManager (com.google.idea.blaze.base.settings.BlazeImportSettingsManager)2 MockModule (com.intellij.mock.MockModule)2 MockFileTypeManager (com.intellij.openapi.fileTypes.MockFileTypeManager)2 ProjectScopeBuilderImpl (com.intellij.psi.search.ProjectScopeBuilderImpl)2 RenderErrorContributor (com.android.tools.idea.rendering.RenderErrorContributor)1 AndroidResourceModuleRegistry (com.google.idea.blaze.android.sync.model.AndroidResourceModuleRegistry)1 BlazeBuildService (com.google.idea.blaze.base.actions.BlazeBuildService)1 BlazeProjectDataManagerImpl (com.google.idea.blaze.base.sync.data.BlazeProjectDataManagerImpl)1 TransitiveDependencyMap (com.google.idea.blaze.base.targetmaps.TransitiveDependencyMap)1 MockFileDocumentManagerImpl (com.intellij.mock.MockFileDocumentManagerImpl)1 MockPsiManager (com.intellij.mock.MockPsiManager)1 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)1 VirtualFileManager (com.intellij.openapi.vfs.VirtualFileManager)1