Skip to content

Commit 08e7ff0

Browse files
committed
Refactor environment extension activation checks to use shouldEnvExtHandleActivation function
1 parent 7b8fad0 commit 08e7ff0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/client/interpreter/display/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
IInterpreterService,
2525
IInterpreterStatusbarVisibilityFilter,
2626
} from '../contracts';
27-
import { useEnvExtension } from '../../envExt/api.internal';
27+
import { shouldEnvExtHandleActivation } from '../../envExt/api.internal';
2828

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

7070
public async activate(): Promise<void> {
71-
if (useEnvExtension()) {
71+
if (shouldEnvExtHandleActivation()) {
7272
return;
7373
}
7474
const application = this.serviceContainer.get<IApplicationShell>(IApplicationShell);
@@ -115,7 +115,7 @@ export class InterpreterDisplay implements IInterpreterDisplay, IExtensionSingle
115115
}
116116
}
117117
private async updateDisplay(workspaceFolder?: Uri) {
118-
if (useEnvExtension()) {
118+
if (shouldEnvExtHandleActivation()) {
119119
this.statusBar?.hide();
120120
this.languageStatus?.dispose();
121121
this.languageStatus = undefined;

src/test/interpreters/display.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ suite('Interpreters Display', () => {
5959
let pathUtils: TypeMoq.IMock<IPathUtils>;
6060
let languageStatusItem: TypeMoq.IMock<LanguageStatusItem>;
6161
let traceLogStub: sinon.SinonStub;
62-
let useEnvExtensionStub: sinon.SinonStub;
62+
let shouldEnvExtHandleActivationStub: sinon.SinonStub;
6363
async function createInterpreterDisplay(filters: IInterpreterStatusbarVisibilityFilter[] = []) {
6464
interpreterDisplay = new InterpreterDisplay(serviceContainer.object);
6565
try {
@@ -69,8 +69,8 @@ suite('Interpreters Display', () => {
6969
}
7070

7171
async function setupMocks(useLanguageStatus: boolean) {
72-
useEnvExtensionStub = sinon.stub(extapi, 'useEnvExtension');
73-
useEnvExtensionStub.returns(false);
72+
shouldEnvExtHandleActivationStub = sinon.stub(extapi, 'shouldEnvExtHandleActivation');
73+
shouldEnvExtHandleActivationStub.returns(false);
7474

7575
serviceContainer = TypeMoq.Mock.ofType<IServiceContainer>();
7676
workspaceService = TypeMoq.Mock.ofType<IWorkspaceService>();

0 commit comments

Comments
 (0)