@@ -93,7 +93,7 @@ interface IExperimentStorageState {
9393 * be incremented when adding a condition, otherwise experiments might activate
9494 * on older versions of VS Code where not intended.
9595 */
96- export const currentSchemaVersion = 2 ;
96+ export const currentSchemaVersion = 3 ;
9797
9898interface IRawExperiment {
9999 id : string ;
@@ -128,6 +128,7 @@ interface IRawExperiment {
128128 userProbability ?: number ;
129129 } ;
130130 action ?: IExperimentAction ;
131+ action2 ?: IExperimentAction ;
131132}
132133
133134interface IActivationEventRecord {
@@ -310,10 +311,11 @@ export class ExperimentService extends Disposable implements IExperimentService
310311 state : ! ! experiment . enabled ? ExperimentState . Evaluating : ExperimentState . NoRun
311312 } ;
312313
313- if ( experiment . action ) {
314+ const action = experiment . action2 || experiment . action ;
315+ if ( action ) {
314316 processedExperiment . action = {
315- type : ExperimentActionType [ experiment . action . type ] || ExperimentActionType . Custom ,
316- properties : experiment . action . properties
317+ type : ExperimentActionType [ action . type ] || ExperimentActionType . Custom ,
318+ properties : action . properties
317319 } ;
318320 if ( processedExperiment . action . type === ExperimentActionType . Prompt ) {
319321 ( ( < IExperimentActionPromptProperties > processedExperiment . action . properties ) . commands || [ ] ) . forEach ( x => {
@@ -557,7 +559,7 @@ export class ExperimentService extends Disposable implements IExperimentService
557559 if ( typeof latestExperimentState . editCount === 'number' && latestExperimentState . editCount >= fileEdits . minEditCount ) {
558560 processedExperiment . state = latestExperimentState . state = ( typeof condition . userProbability === 'number' && Math . random ( ) < condition . userProbability && this . checkExperimentDependencies ( experiment ) ) ? ExperimentState . Run : ExperimentState . NoRun ;
559561 this . storageService . store ( storageKey , JSON . stringify ( latestExperimentState ) , StorageScope . GLOBAL ) ;
560- if ( latestExperimentState . state === ExperimentState . Run && experiment . action && ExperimentActionType [ experiment . action . type ] === ExperimentActionType . Prompt ) {
562+ if ( latestExperimentState . state === ExperimentState . Run && processedExperiment . action && ExperimentActionType [ processedExperiment . action . type ] === ExperimentActionType . Prompt ) {
561563 this . fireRunExperiment ( processedExperiment ) ;
562564 }
563565 }
0 commit comments