@@ -15,8 +15,7 @@ export class SettingsEditor {
15
15
constructor ( private code : Code , private userDataPath : string , private editors : Editors , private editor : Editor , private quickaccess : QuickAccess ) { }
16
16
17
17
async addUserSetting ( setting : string , value : string ) : Promise < void > {
18
- await this . openSettings ( ) ;
19
- await this . editor . waitForEditorFocus ( 'settings.json' , 1 ) ;
18
+ await this . openUserSettingsFile ( ) ;
20
19
21
20
await this . code . dispatchKeybinding ( 'right' ) ;
22
21
await this . editor . waitForTypeInEditor ( 'settings.json' , `"${ setting } ": ${ value } ,` ) ;
@@ -27,11 +26,12 @@ export class SettingsEditor {
27
26
const settingsPath = path . join ( this . userDataPath , 'User' , 'settings.json' ) ;
28
27
await new Promise < void > ( ( c , e ) => fs . writeFile ( settingsPath , '{\n}' , 'utf8' , err => err ? e ( err ) : c ( ) ) ) ;
29
28
30
- await this . openSettings ( ) ;
29
+ await this . openUserSettingsFile ( ) ;
31
30
await this . editor . waitForEditorContents ( 'settings.json' , c => c === '{}' ) ;
32
31
}
33
32
34
- private async openSettings ( ) : Promise < void > {
33
+ async openUserSettingsFile ( ) : Promise < void > {
35
34
await this . quickaccess . runCommand ( 'workbench.action.openSettingsJson' ) ;
35
+ await this . editor . waitForEditorFocus ( 'settings.json' , 1 ) ;
36
36
}
37
37
}
0 commit comments