File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -192,12 +192,12 @@ export function load(): ISettings {
192
192
} ;
193
193
}
194
194
195
- export function change ( settingName : string , newValue : any , global : boolean = false ) : Thenable < void > {
195
+ export async function change ( settingName : string , newValue : any , global : boolean = false ) : Promise < void > {
196
196
const configuration : vscode . WorkspaceConfiguration =
197
197
vscode . workspace . getConfiguration (
198
198
utils . PowerShellLanguageId ) ;
199
199
200
- return configuration . update ( settingName , newValue , global ) ;
200
+ await configuration . update ( settingName , newValue , global ) ;
201
201
}
202
202
203
203
function getWorkspaceSettingsWithDefaults < TSettings > (
Original file line number Diff line number Diff line change @@ -19,4 +19,14 @@ suite("Settings module", () => {
19
19
assert . deepEqual ( settings . developer . featureFlags , [ ] ) ;
20
20
}
21
21
} ) ;
22
+
23
+ test ( "Settings update correctly" , async ( ) => {
24
+ // then syntax
25
+ Settings . change ( "powerShellExePath" , "dummypath1" , false ) . then ( ( ) =>
26
+ assert . strictEqual ( Settings . load ( ) . powerShellExePath , "dummypath1" ) ) ;
27
+
28
+ // async/await syntax
29
+ await Settings . change ( "powerShellExePath" , "dummypath2" , false ) ;
30
+ assert . strictEqual ( Settings . load ( ) . powerShellExePath , "dummypath2" ) ;
31
+ } ) ;
22
32
} ) ;
You can’t perform that action at this time.
0 commit comments