@@ -10,6 +10,7 @@ import { IWorkbenchContributionsRegistry, IWorkbenchContribution, Extensions as
1010import { Registry } from 'vs/platform/registry/common/platform' ;
1111import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
1212import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
13+ import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys' ;
1314import { ISurveyData , IProductService } from 'vs/platform/product/common/productService' ;
1415import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle' ;
1516import { Severity , INotificationService } from 'vs/platform/notification/common/notification' ;
@@ -25,6 +26,7 @@ class LanguageSurvey extends Disposable {
2526 constructor (
2627 data : ISurveyData ,
2728 storageService : IStorageService ,
29+ storageKeysSyncRegistryService : IStorageKeysSyncRegistryService ,
2830 notificationService : INotificationService ,
2931 telemetryService : ITelemetryService ,
3032 modelService : IModelService ,
@@ -41,6 +43,14 @@ class LanguageSurvey extends Disposable {
4143 const EDITED_LANGUAGE_COUNT_KEY = `${ data . surveyId } .editedCount` ;
4244 const EDITED_LANGUAGE_DATE_KEY = `${ data . surveyId } .editedDate` ;
4345
46+ // opt-in to syncing
47+ storageKeysSyncRegistryService . registerStorageKey ( { key : SESSION_COUNT_KEY , version : 1 } ) ;
48+ storageKeysSyncRegistryService . registerStorageKey ( { key : LAST_SESSION_DATE_KEY , version : 1 } ) ;
49+ storageKeysSyncRegistryService . registerStorageKey ( { key : SKIP_VERSION_KEY , version : 1 } ) ;
50+ storageKeysSyncRegistryService . registerStorageKey ( { key : IS_CANDIDATE_KEY , version : 1 } ) ;
51+ storageKeysSyncRegistryService . registerStorageKey ( { key : EDITED_LANGUAGE_COUNT_KEY , version : 1 } ) ;
52+ storageKeysSyncRegistryService . registerStorageKey ( { key : EDITED_LANGUAGE_DATE_KEY , version : 1 } ) ;
53+
4454 const skipVersion = storageService . get ( SKIP_VERSION_KEY , StorageScope . GLOBAL , '' ) ;
4555 if ( skipVersion ) {
4656 return ;
@@ -131,6 +141,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
131141
132142 constructor (
133143 @IStorageService storageService : IStorageService ,
144+ @IStorageKeysSyncRegistryService storageKeysSyncRegistryService : IStorageKeysSyncRegistryService ,
134145 @INotificationService notificationService : INotificationService ,
135146 @ITelemetryService telemetryService : ITelemetryService ,
136147 @IModelService modelService : IModelService ,
@@ -144,7 +155,7 @@ class LanguageSurveysContribution implements IWorkbenchContribution {
144155
145156 productService . surveys
146157 . filter ( surveyData => surveyData . surveyId && surveyData . editCount && surveyData . languageId && surveyData . surveyUrl && surveyData . userProbability )
147- . map ( surveyData => new LanguageSurvey ( surveyData , storageService , notificationService , telemetryService , modelService , textFileService , openerService , productService ) ) ;
158+ . map ( surveyData => new LanguageSurvey ( surveyData , storageService , storageKeysSyncRegistryService , notificationService , telemetryService , modelService , textFileService , openerService , productService ) ) ;
148159 }
149160}
150161
0 commit comments