Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of mocked output channel in virtual workspace (#24051) #24056

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/client/extensionInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { Container } from 'inversify';
import { Disposable, Memento, window } from 'vscode';
import { instance, mock } from 'ts-mockito';
import { registerTypes as platformRegisterTypes } from './common/platform/serviceRegistry';
import { registerTypes as processRegisterTypes } from './common/process/serviceRegistry';
import { registerTypes as commonRegisterTypes } from './common/serviceRegistry';
Expand All @@ -29,7 +28,6 @@ import * as pythonEnvironments from './pythonEnvironments';
import { IDiscoveryAPI } from './pythonEnvironments/base/locator';
import { registerLogger } from './logging';
import { OutputChannelLogger } from './logging/outputChannelLogger';
import { WorkspaceService } from './common/application/workspace';

// The code in this module should do nothing more complex than register
// objects to DI and simple init (e.g. no side effects). That implies
Expand Down Expand Up @@ -57,12 +55,7 @@ export function initializeGlobals(
disposables.push(standardOutputChannel);
disposables.push(registerLogger(new OutputChannelLogger(standardOutputChannel)));

const workspaceService = new WorkspaceService();
const unitTestOutChannel =
workspaceService.isVirtualWorkspace || !workspaceService.isTrusted
? // Do not create any test related output UI when using virtual workspaces.
instance(mock<ITestOutputChannel>())
: window.createOutputChannel(OutputChannelNames.pythonTest);
const unitTestOutChannel = window.createOutputChannel(OutputChannelNames.pythonTest);
disposables.push(unitTestOutChannel);

serviceManager.addSingletonInstance<ILogOutputChannel>(ILogOutputChannel, standardOutputChannel);
Expand Down
Loading