@@ -14,7 +14,7 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
14
14
import { INotificationService } from 'vs/platform/notification/common/notification' ;
15
15
import { IQuickInputService , IQuickPickItem } from 'vs/platform/quickinput/common/quickInput' ;
16
16
import { asJson , asText , IRequestService } from 'vs/platform/request/common/request' ;
17
- import { IUserDataProfileTemplate , isUserDataProfileTemplate , IUserDataProfileManagementService , IUserDataProfileWorkbenchService , PROFILES_CATEGORY , PROFILE_EXTENSION , PROFILE_FILTER , ManageProfilesSubMenu , IUserDataProfileService , PROFILES_ENABLEMENT_CONTEXT } from 'vs/workbench/services/userDataProfile/common/userDataProfile' ;
17
+ import { IUserDataProfileTemplate , isUserDataProfileTemplate , IUserDataProfileManagementService , IUserDataProfileImportExportService , PROFILES_CATEGORY , PROFILE_EXTENSION , PROFILE_FILTER , ManageProfilesSubMenu , IUserDataProfileService , PROFILES_ENABLEMENT_CONTEXT } from 'vs/workbench/services/userDataProfile/common/userDataProfile' ;
18
18
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles' ;
19
19
import { IUserDataProfile , IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile' ;
20
20
import { CATEGORIES } from 'vs/workbench/common/actions' ;
@@ -25,7 +25,7 @@ registerAction2(class CreateFromCurrentProfileAction extends Action2 {
25
25
super ( {
26
26
id : 'workbench.profiles.actions.createFromCurrentProfile' ,
27
27
title : {
28
- value : localize ( 'save profile as' , "Create from Current Profile..." ) ,
28
+ value : localize ( 'save profile as' , "Create from Current Settings Profile..." ) ,
29
29
original : 'Create from Current Profile...'
30
30
} ,
31
31
category : PROFILES_CATEGORY ,
@@ -47,7 +47,7 @@ registerAction2(class CreateFromCurrentProfileAction extends Action2 {
47
47
const userDataProfileManagementService = accessor . get ( IUserDataProfileManagementService ) ;
48
48
const name = await quickInputService . input ( {
49
49
placeHolder : localize ( 'name' , "Profile name" ) ,
50
- title : localize ( 'save profile as' , "Create from Current Profile..." ) ,
50
+ title : localize ( 'save profile as' , "Create from Current Settings Profile..." ) ,
51
51
} ) ;
52
52
if ( name ) {
53
53
await userDataProfileManagementService . createAndEnterProfile ( name , undefined , true ) ;
@@ -60,7 +60,7 @@ registerAction2(class CreateEmptyProfileAction extends Action2 {
60
60
super ( {
61
61
id : 'workbench.profiles.actions.createProfile' ,
62
62
title : {
63
- value : localize ( 'create profile' , "Create an Empty Profile..." ) ,
63
+ value : localize ( 'create profile' , "Create an Empty Settings Profile..." ) ,
64
64
original : 'Create an Empty Profile...'
65
65
} ,
66
66
category : PROFILES_CATEGORY ,
@@ -95,7 +95,7 @@ registerAction2(class RemoveProfileAction extends Action2 {
95
95
super ( {
96
96
id : 'workbench.profiles.actions.removeProfile' ,
97
97
title : {
98
- value : localize ( 'remove profile' , "Remove Profile..." ) ,
98
+ value : localize ( 'remove profile' , "Remove Settings Profile..." ) ,
99
99
original : 'Remove Profile...'
100
100
} ,
101
101
category : PROFILES_CATEGORY ,
@@ -132,8 +132,8 @@ registerAction2(class SwitchProfileAction extends Action2 {
132
132
super ( {
133
133
id : 'workbench.profiles.actions.switchProfile' ,
134
134
title : {
135
- value : localize ( 'switch profile' , "Switch Settings Profile" ) ,
136
- original : 'Switch Settings Profile'
135
+ value : localize ( 'switch profile' , "Switch Settings Profile... " ) ,
136
+ original : 'Switch Settings Profile... '
137
137
} ,
138
138
category : PROFILES_CATEGORY ,
139
139
f1 : true ,
@@ -167,7 +167,7 @@ registerAction2(class CleanupProfilesAction extends Action2 {
167
167
super ( {
168
168
id : 'workbench.profiles.actions.cleanupProfiles' ,
169
169
title : {
170
- value : localize ( 'cleanup profile' , "Cleanup Profiles" ) ,
170
+ value : localize ( 'cleanup profile' , "Cleanup Settings Profiles" ) ,
171
171
original : 'Cleanup Profiles'
172
172
} ,
173
173
category : CATEGORIES . Developer ,
@@ -190,21 +190,29 @@ registerAction2(class CleanupProfilesAction extends Action2 {
190
190
registerAction2 ( class ExportProfileAction extends Action2 {
191
191
constructor ( ) {
192
192
super ( {
193
- id : 'workbench.profiles.actions.exportProfile2 ' ,
193
+ id : 'workbench.profiles.actions.exportProfile ' ,
194
194
title : {
195
- value : localize ( 'export profile' , "Export Settings as a Profile (2) ..." ) ,
196
- original : 'Export Settings as a Profile as a Profile (2) ...'
195
+ value : localize ( 'export profile' , "Export Settings Profile..." ) ,
196
+ original : 'Export Settings Profile...'
197
197
} ,
198
198
category : PROFILES_CATEGORY ,
199
199
f1 : true ,
200
200
precondition : PROFILES_ENABLEMENT_CONTEXT ,
201
+ menu : [
202
+ {
203
+ id : ManageProfilesSubMenu ,
204
+ group : '3_import_export_profiles' ,
205
+ when : PROFILES_ENABLEMENT_CONTEXT ,
206
+ order : 1
207
+ }
208
+ ]
201
209
} ) ;
202
210
}
203
211
204
212
async run ( accessor : ServicesAccessor ) {
205
213
const textFileService = accessor . get ( ITextFileService ) ;
206
214
const fileDialogService = accessor . get ( IFileDialogService ) ;
207
- const profileService = accessor . get ( IUserDataProfileWorkbenchService ) ;
215
+ const userDataProfileImportExportService = accessor . get ( IUserDataProfileImportExportService ) ;
208
216
const notificationService = accessor . get ( INotificationService ) ;
209
217
210
218
const profileLocation = await fileDialogService . showSaveDialog ( {
@@ -217,7 +225,7 @@ registerAction2(class ExportProfileAction extends Action2 {
217
225
return ;
218
226
}
219
227
220
- const profile = await profileService . createProfile ( { skipComments : true } ) ;
228
+ const profile = await userDataProfileImportExportService . exportProfile ( { skipComments : true } ) ;
221
229
await textFileService . create ( [ { resource : profileLocation , value : JSON . stringify ( profile ) , options : { overwrite : true } } ] ) ;
222
230
223
231
notificationService . info ( localize ( 'export success' , "{0}: Exported successfully." , PROFILES_CATEGORY ) ) ;
@@ -227,14 +235,22 @@ registerAction2(class ExportProfileAction extends Action2 {
227
235
registerAction2 ( class ImportProfileAction extends Action2 {
228
236
constructor ( ) {
229
237
super ( {
230
- id : 'workbench.profiles.actions.importProfile2 ' ,
238
+ id : 'workbench.profiles.actions.importProfile ' ,
231
239
title : {
232
- value : localize ( 'import profile' , "Import Settings from a Profile (2) ..." ) ,
233
- original : 'Import Settings from a Profile (2) ...'
240
+ value : localize ( 'import profile' , "Import Settings Profile..." ) ,
241
+ original : 'Import Settings Profile...'
234
242
} ,
235
243
category : PROFILES_CATEGORY ,
236
244
f1 : true ,
237
245
precondition : PROFILES_ENABLEMENT_CONTEXT ,
246
+ menu : [
247
+ {
248
+ id : ManageProfilesSubMenu ,
249
+ group : '3_import_export_profiles' ,
250
+ when : PROFILES_ENABLEMENT_CONTEXT ,
251
+ order : 2
252
+ }
253
+ ]
238
254
} ) ;
239
255
}
240
256
@@ -243,7 +259,7 @@ registerAction2(class ImportProfileAction extends Action2 {
243
259
const quickInputService = accessor . get ( IQuickInputService ) ;
244
260
const fileService = accessor . get ( IFileService ) ;
245
261
const requestService = accessor . get ( IRequestService ) ;
246
- const userDataProfileMangementService = accessor . get ( IUserDataProfileManagementService ) ;
262
+ const userDataProfileImportExportService = accessor . get ( IUserDataProfileImportExportService ) ;
247
263
248
264
const disposables = new DisposableStore ( ) ;
249
265
const quickPick = disposables . add ( quickInputService . createQuickPick ( ) ) ;
@@ -262,13 +278,7 @@ registerAction2(class ImportProfileAction extends Action2 {
262
278
quickPick . hide ( ) ;
263
279
const profile = quickPick . selectedItems [ 0 ] . description ? await this . getProfileFromURL ( quickPick . value , requestService ) : await this . getProfileFromFileSystem ( fileDialogService , fileService ) ;
264
280
if ( profile ) {
265
- const name = await quickInputService . input ( {
266
- placeHolder : localize ( 'name' , "Profile name" ) ,
267
- title : localize ( 'save profile as' , "Create from Current Profile..." ) ,
268
- } ) ;
269
- if ( name ) {
270
- await userDataProfileMangementService . createAndEnterProfileFromTemplate ( name , profile ) ;
271
- }
281
+ await userDataProfileImportExportService . importProfile ( profile ) ;
272
282
}
273
283
} ) ) ;
274
284
disposables . add ( quickPick . onDidHide ( ( ) => disposables . dispose ( ) ) ) ;
0 commit comments