Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions src/client/interpreter/display/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
IInterpreterService,
IInterpreterStatusbarVisibilityFilter,
} from '../contracts';
import { useEnvExtension } from '../../envExt/api.internal';
import { shouldEnvExtHandleActivation } from '../../envExt/api.internal';

/**
* Based on https://github.com/microsoft/vscode-python/issues/18040#issuecomment-992567670.
Expand Down Expand Up @@ -68,7 +68,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
}

public async activate(): Promise<void> {
if (useEnvExtension()) {
if (shouldEnvExtHandleActivation()) {
return;
}
const application = this.serviceContainer.get<IApplicationShell>(IApplicationShell);
Expand Down Expand Up @@ -115,7 +115,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
}
}
private async updateDisplay(workspaceFolder?: Uri) {
if (useEnvExtension()) {
if (shouldEnvExtHandleActivation()) {
this.statusBar?.hide();
this.languageStatus?.dispose();
this.languageStatus = undefined;
Expand Down
6 changes: 3 additions & 3 deletions src/test/interpreters/display.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ suite('Interpreters Display', () => {
let pathUtils: TypeMoq.IMock<IPathUtils>;
let languageStatusItem: TypeMoq.IMock<LanguageStatusItem>;
let traceLogStub: sinon.SinonStub;
let useEnvExtensionStub: sinon.SinonStub;
let shouldEnvExtHandleActivationStub: sinon.SinonStub;
async function createInterpreterDisplay(filters: IInterpreterStatusbarVisibilityFilter[] = []) {
interpreterDisplay = new InterpreterDisplay(serviceContainer.object);
try {
Expand All @@ -69,8 +69,8 @@ suite('Interpreters Display', () => {
}

async function setupMocks(useLanguageStatus: boolean) {
useEnvExtensionStub = sinon.stub(extapi, 'useEnvExtension');
useEnvExtensionStub.returns(false);
shouldEnvExtHandleActivationStub = sinon.stub(extapi, 'shouldEnvExtHandleActivation');
shouldEnvExtHandleActivationStub.returns(false);

serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
workspaceService = TypeMoq.Mock.ofType<IWorkspaceService>();
Expand Down
Loading