use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverProvider in project intellij by bazelbuild.
the class ProjectViewUi method setDummyWorkspacePathResolverProvider.
private void setDummyWorkspacePathResolverProvider(WorkspacePathResolver workspacePathResolver) {
MutablePicoContainer container = (MutablePicoContainer) getProject().getPicoContainer();
Class<WorkspacePathResolverProvider> key = WorkspacePathResolverProvider.class;
Object oldProvider = container.getComponentInstance(key);
container.unregisterComponent(key.getName());
container.registerComponentInstance(key.getName(), (WorkspacePathResolverProvider) () -> workspacePathResolver);
if (!settingsInitialized) {
Disposer.register(parentDisposable, () -> {
container.unregisterComponent(key.getName());
if (oldProvider != null) {
container.registerComponentInstance(key.getName(), oldProvider);
}
});
}
}
Aggregations