@@ -58,7 +58,7 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService
58
58
import { IURLHandler , IURLService } from 'vs/platform/url/common/url' ;
59
59
import { asText , IRequestService } from 'vs/platform/request/common/request' ;
60
60
import { IProductService } from 'vs/platform/product/common/productService' ;
61
- import { isUndefined } from 'vs/base/common/types' ;
61
+ import { Mutable , isUndefined } from 'vs/base/common/types' ;
62
62
import { Action , ActionRunner , IAction , IActionRunner } from 'vs/base/common/actions' ;
63
63
import { isWeb } from 'vs/base/common/platform' ;
64
64
import { Action2 , MenuId , registerAction2 } from 'vs/platform/actions/common/actions' ;
@@ -204,7 +204,7 @@ export class UserDataProfileImportExportService extends Disposable implements IU
204
204
location : ProgressLocation . Window ,
205
205
command : showWindowLogActionId ,
206
206
title : localize ( 'resolving uri' , "{0}: Resolving profile content..." , options ?. mode ? localize ( 'preview profile' , "Preview Profile" ) : localize ( 'import profile' , "Create Profile" ) ) ,
207
- } , ( ) => this . resolveProfileTemplate ( uri ) ) ;
207
+ } , ( ) => this . resolveProfileTemplate ( uri , options ) ) ;
208
208
if ( ! profileTemplate ) {
209
209
return ;
210
210
}
@@ -348,17 +348,21 @@ export class UserDataProfileImportExportService extends Disposable implements IU
348
348
}
349
349
}
350
350
351
- private async resolveProfileTemplate ( uri : URI ) : Promise < IUserDataProfileTemplate | null > {
351
+ private async resolveProfileTemplate ( uri : URI , options ?: IProfileImportOptions ) : Promise < IUserDataProfileTemplate | null > {
352
352
const profileContent = await this . resolveProfileContent ( uri ) ;
353
353
if ( profileContent === null ) {
354
354
return null ;
355
355
}
356
356
357
- const profileTemplate : IUserDataProfileTemplate = JSON . parse ( profileContent ) ;
357
+ const profileTemplate : Mutable < IUserDataProfileTemplate > = JSON . parse ( profileContent ) ;
358
358
if ( ! isUserDataProfileTemplate ( profileTemplate ) ) {
359
359
throw new Error ( 'Invalid profile content.' ) ;
360
360
}
361
361
362
+ if ( options ?. name ) {
363
+ profileTemplate . name = options . name ;
364
+ }
365
+
362
366
return profileTemplate ;
363
367
}
364
368
0 commit comments