@@ -16,7 +16,7 @@ import { WorkspaceService } from '../../../client/common/application/workspace';
16
16
import { ConfigurationService } from '../../../client/common/configuration/service' ;
17
17
import { Commands } from '../../../client/common/constants' ;
18
18
import { LinterInstallationPromptVariants } from '../../../client/common/experiments/groups' ;
19
- import { ExperimentsManager } from '../../../client/common/experiments/manager ' ;
19
+ import { ExperimentService } from '../../../client/common/experiments/service ' ;
20
20
import '../../../client/common/extensions' ;
21
21
import {
22
22
CTagsInstallationScript ,
@@ -46,7 +46,7 @@ import { ITerminalService, ITerminalServiceFactory } from '../../../client/commo
46
46
import {
47
47
IConfigurationService ,
48
48
IDisposableRegistry ,
49
- IExperimentsManager ,
49
+ IExperimentService ,
50
50
InstallerResponse ,
51
51
IOutputChannel ,
52
52
IPersistentState ,
@@ -980,7 +980,7 @@ suite('Module Installer only', () => {
980
980
let workspaceService : IWorkspaceService ;
981
981
let productService : IProductService ;
982
982
let cmdManager : ICommandManager ;
983
- let experimentsManager : IExperimentsManager ;
983
+ let experimentsService : IExperimentService ;
984
984
let linterManager : ILinterManager ;
985
985
let serviceContainer : IServiceContainer ;
986
986
let productPathService : IProductPathService ;
@@ -992,7 +992,7 @@ suite('Module Installer only', () => {
992
992
workspaceService = mock ( WorkspaceService ) ;
993
993
productService = mock ( ProductService ) ;
994
994
cmdManager = mock ( CommandManager ) ;
995
- experimentsManager = mock ( ExperimentsManager ) ;
995
+ experimentsService = mock ( ExperimentService ) ;
996
996
linterManager = mock ( LinterManager ) ;
997
997
productPathService = mock ( LinterProductPathService ) ;
998
998
outputChannel = TypeMoq . Mock . ofType < IOutputChannel > ( ) ;
@@ -1005,9 +1005,9 @@ suite('Module Installer only', () => {
1005
1005
when ( serviceContainer . get < IProductService > ( IProductService ) ) . thenReturn ( instance ( productService ) ) ;
1006
1006
when ( serviceContainer . get < ICommandManager > ( ICommandManager ) ) . thenReturn ( instance ( cmdManager ) ) ;
1007
1007
1008
- const exp = instance ( experimentsManager ) ;
1009
- when ( serviceContainer . get < IExperimentsManager > ( IExperimentsManager ) ) . thenReturn ( exp ) ;
1010
- when ( experimentsManager . inExperiment ( anything ( ) ) ) . thenReturn ( false ) ;
1008
+ const exp = instance ( experimentsService ) ;
1009
+ when ( serviceContainer . get < IExperimentService > ( IExperimentService ) ) . thenReturn ( exp ) ;
1010
+ when ( experimentsService . inExperiment ( anything ( ) ) ) . thenResolve ( false ) ;
1011
1011
1012
1012
when ( serviceContainer . get < ILinterManager > ( ILinterManager ) ) . thenReturn ( instance ( linterManager ) ) ;
1013
1013
when ( serviceContainer . get < IProductPathService > ( IProductPathService , ProductType . Linter ) ) . thenReturn (
@@ -1084,7 +1084,7 @@ suite('Module Installer only', () => {
1084
1084
1085
1085
await installer . promptToInstallImplementation ( product , resource ) ;
1086
1086
1087
- verify ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . never ( ) ;
1087
+ verify ( experimentsService . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . never ( ) ;
1088
1088
verify (
1089
1089
appShell . showErrorMessage ( `Linter ${ productName } is not installed.` , 'Install' , options [ 0 ] , options [ 1 ] )
1090
1090
) . once ( ) ;
@@ -1102,14 +1102,14 @@ suite('Module Installer only', () => {
1102
1102
when ( productPathService . getExecutableNameFromSettings ( Product . pylint , resource ) ) . thenReturn (
1103
1103
'path/to/something'
1104
1104
) ;
1105
- when ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . thenReturn ( true ) ;
1105
+ when ( experimentsService . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . thenResolve ( true ) ;
1106
1106
installer . isModuleExecutable = false ;
1107
1107
1108
1108
const product = Product . pylint ;
1109
1109
const options = [ 'Select Linter' , 'Do not show again' ] ;
1110
1110
const productName = ProductNames . get ( product ) ! ;
1111
1111
await installer . promptToInstallImplementation ( product , resource ) ;
1112
- verify ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . once ( ) ;
1112
+ verify ( experimentsService . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . once ( ) ;
1113
1113
verify (
1114
1114
appShell . showInformationMessage (
1115
1115
Linters . installMessage ( ) ,
@@ -1134,11 +1134,11 @@ suite('Module Installer only', () => {
1134
1134
const product = Product . pylint ;
1135
1135
const options = [ 'Select Linter' , 'Do not show again' ] ;
1136
1136
const productName = ProductNames . get ( product ) ! ;
1137
- when ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . thenReturn ( true ) ;
1137
+ when ( experimentsService . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . thenResolve ( true ) ;
1138
1138
1139
1139
const response = await installer . promptToInstallImplementation ( product , resource ) ;
1140
1140
1141
- verify ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . once ( ) ;
1141
+ verify ( experimentsService . inExperiment ( LinterInstallationPromptVariants . noPrompt ) ) . once ( ) ;
1142
1142
verify (
1143
1143
appShell . showErrorMessage ( `Linter ${ productName } is not installed.` , 'Install' , options [ 0 ] , options [ 1 ] )
1144
1144
) . never ( ) ;
@@ -1147,11 +1147,11 @@ suite('Module Installer only', () => {
1147
1147
1148
1148
test ( 'pylint first Experiment: Linter should install pylint first and install flake8 next' , async ( ) => {
1149
1149
const product = Product . pylint ;
1150
- when ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . pylintFirst ) ) . thenReturn ( true ) ;
1150
+ when ( experimentsService . inExperiment ( LinterInstallationPromptVariants . pylintFirst ) ) . thenResolve ( true ) ;
1151
1151
1152
1152
await installer . promptToInstallImplementation ( product , resource ) ;
1153
1153
1154
- verify ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . pylintFirst ) ) . once ( ) ;
1154
+ verify ( experimentsService . inExperiment ( LinterInstallationPromptVariants . pylintFirst ) ) . once ( ) ;
1155
1155
verify (
1156
1156
appShell . showInformationMessage (
1157
1157
Linters . installMessage ( ) ,
@@ -1164,11 +1164,11 @@ suite('Module Installer only', () => {
1164
1164
1165
1165
test ( 'flake8 first Experiment: Linter should install flake8 first and install pylint next' , async ( ) => {
1166
1166
const product = Product . pylint ;
1167
- when ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . thenReturn ( true ) ;
1167
+ when ( experimentsService . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . thenResolve ( true ) ;
1168
1168
1169
1169
await installer . promptToInstallImplementation ( product , resource ) ;
1170
1170
1171
- verify ( experimentsManager . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . once ( ) ;
1171
+ verify ( experimentsService . inExperiment ( LinterInstallationPromptVariants . flake8First ) ) . once ( ) ;
1172
1172
verify (
1173
1173
appShell . showInformationMessage (
1174
1174
Linters . installMessage ( ) ,
0 commit comments