Skip to content

Commit db04ec6

Browse files
committed
Address comments.
1 parent 5ffb3f8 commit db04ec6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/client/common/utils/localize.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,10 @@ export namespace ToolsExtensions {
487487
);
488488

489489
export const installBlackFormatterPrompt = l10n.t(
490-
'You triggered formatting with Black, would you like to install one of the formatter extensions? This will also set it as the default formatter for python.',
490+
'You triggered formatting with Black, would you like to install one of our new formatter extensions? This will also set it as the default formatter for Python.',
491491
);
492492

493493
export const installAutopep8FormatterPrompt = l10n.t(
494-
'You triggered formatting with Autopep8, would you like to install one of the formatter extension? This will also set it as the default formatter for python.',
494+
'You triggered formatting with Autopep8, would you like to install one of our new formatter extension? This will also set it as the default formatter for Python.',
495495
);
496496
}

src/client/providers/prompts/installFormatterPrompt.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class InstallFormatterPrompt implements IInstallFormatterPrompt {
2424
constructor(private readonly serviceContainer: IServiceContainer) {}
2525

2626
public async showInstallFormatterPrompt(resource?: Uri): Promise<void> {
27-
if (!(await inFormatterExtensionExperiment(this.serviceContainer))) {
27+
if (!inFormatterExtensionExperiment(this.serviceContainer)) {
2828
return;
2929
}
3030

src/client/providers/prompts/promptUtils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import { isInsider } from '../../common/vscodeApis/extensionsApi';
99
import { getConfiguration, getWorkspaceFolder } from '../../common/vscodeApis/workspaceApis';
1010
import { IServiceContainer } from '../../ioc/types';
1111

12-
export function inFormatterExtensionExperiment(serviceContainer: IServiceContainer): Promise<boolean> {
12+
export function inFormatterExtensionExperiment(serviceContainer: IServiceContainer): boolean {
1313
const experiment = serviceContainer.get<IExperimentService>(IExperimentService);
14-
return experiment.inExperiment(ShowFormatterExtensionPrompt.experiment);
14+
return experiment.inExperimentSync(ShowFormatterExtensionPrompt.experiment);
1515
}
1616

1717
export function doNotShowPromptState(key: string, serviceContainer: IServiceContainer): IPersistentState<boolean> {

src/test/providers/prompt/installFormatterPrompt.unit.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ suite('Formatter Extension prompt tests', () => {
3131

3232
setup(() => {
3333
inFormatterExtensionExperimentStub = sinon.stub(promptUtils, 'inFormatterExtensionExperiment');
34-
inFormatterExtensionExperimentStub.resolves(true);
34+
inFormatterExtensionExperimentStub.returns(true);
3535

3636
doNotShowPromptStateStub = sinon.stub(promptUtils, 'doNotShowPromptState');
3737
persistState = TypeMoq.Mock.ofType<IPersistentState<boolean>>();
@@ -61,7 +61,7 @@ suite('Formatter Extension prompt tests', () => {
6161
});
6262

6363
test('Not in experiment', async () => {
64-
inFormatterExtensionExperimentStub.resolves(false);
64+
inFormatterExtensionExperimentStub.returns(false);
6565

6666
await prompt.showInstallFormatterPrompt();
6767
assert.isTrue(doNotShowPromptStateStub.notCalled);

0 commit comments

Comments
 (0)