10000 Do not deprecate `python.terminal.activateEnvironmentInTerminal` sett… · microsoft/vscode-python@96aa8f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 96aa8f8

Browse files
author
Kartik Raj
authored
Do not deprecate python.terminal.activateEnvironmentInTerminal setting along with terminal env var experiment (#20952)
I initially deprecated this setting as I thought folks only disabled it because we were sending commands which was annoying.
1 parent 37a70fd commit 96aa8f8

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

src/client/common/terminal/activator/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
import { inject, injectable, multiInject } from 'inversify';
77
import { Terminal } from 'vscode';
8-
import { inTerminalEnvVarExperiment } from '../../experiments/helpers';
9-
import { IConfigurationService, IExperimentService } from '../../types';
8+
import { IConfigurationService } from '../../types';
109
import { ITerminalActivationHandler, ITerminalActivator, ITerminalHelper, TerminalActivationOptions } from '../types';
1110
import { BaseTerminalActivator } from './base';
1211

@@ -18,7 +17,6 @@ export class TerminalActivator implements ITerminalActivator {
1817
@inject(ITerminalHelper) readonly helper: ITerminalHelper,
1918
@multiInject(ITerminalActivationHandler) private readonly handlers: ITerminalActivationHandler[],
2019
@inject(IConfigurationService) private readonly configurationService: IConfigurationService,
21-
@inject(IExperimentService) private readonly experimentService: IExperimentService,
2220
) {
2321
this.initialize();
2422
}
@@ -39,8 +37,7 @@ export class TerminalActivator implements ITerminalActivator {
3937
options?: TerminalActivationOptions,
4038
): Promise<boolean> {
4139
const settings = this.configurationService.getSettings(options?.resource);
42-
const activateEnvironment =
43-
settings.terminal.activateEnvironment && !inTerminalEnvVarExperiment(this.experimentService);
40+
const activateEnvironment = settings.terminal.activateEnvironment;
4441
if (!activateEnvironment || options?.hideFromUser) {
4542
return false;
4643
}

src/test/common/terminals/activator/index.unit.test.ts

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,45 +12,32 @@ import {
1212
ITerminalActivator,
1313
ITerminalHelper,
1414
} from '../../../../client/common/terminal/types';
15-
import {
16-
IConfigurationService,
17-
IExperimentService,
18-
IPythonSettings,
19-
ITerminalSettings,
20-
} from '../../../../client/common/types';
15+
import { IConfigurationService, IPythonSettings, ITerminalSettings } from '../../../../client/common/types';
2116

2217
suite('Terminal Activator', () => {
2318
let activator: TerminalActivator;
2419
let baseActivator: TypeMoq.IMock<ITerminalActivator>;
2520
let handler1: TypeMoq.IMock<ITerminalActivationHandler>;
2621
let handler2: TypeMoq.IMock<ITerminalActivationHandler>;
2722
let terminalSettings: TypeMoq.IMock<ITerminalSettings>;
28-
let experimentService: TypeMoq.IMock<IExperimentService>;
2923
setup(() => {
3024
baseActivator = TypeMoq.Mock.ofType<ITerminalActivator>();
3125
terminalSettings = TypeMoq.Mock.ofType<ITerminalSettings>();
3226
handler1 = TypeMoq.Mock.ofType<ITerminalActivationHandler>();
3327
handler2 = TypeMoq.Mock.ofType<ITerminalActivationHandler>();
3428
const configService = TypeMoq.Mock.ofType<IConfigurationService>();
35-
experimentService = TypeMoq.Mock.ofType<IExperimentService>();
3629
configService
3730
.setup((c) => c.getSettings(TypeMoq.It.isAny()))
3831
.returns(() => {
3932
return ({
4033
terminal: terminalSettings.object,
4134
} as unknown) as IPythonSettings;
4235
});
43-
experimentService.setup((e) => e.inExperimentSync(TypeMoq.It.isAny())).returns(() => false);
4436
activator = new (class extends TerminalActivator {
4537
protected initialize() {
4638
this.baseActivator = baseActivator.object;
4739
}
48-
})(
49-
TypeMoq.Mock.ofType<ITerminalHelper>().object,
50-
[handler1.object, handler2.object],
51-
configService.object,
52-
experimentService.object,
53-
);
40+
})(TypeMoq.Mock.ofType<ITerminalHelper>().object, [handler1.object, handler2.object], configService.object);
5441
});
5542
async function testActivationAndHandlers(
5643
activationSuccessful: boolean,

0 commit comments

Comments
 (0)
0