File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 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 {
192192 } ;
193193}
194194
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 > {
196196 const configuration : vscode . WorkspaceConfiguration =
197197 vscode . workspace . getConfiguration (
198198 utils . PowerShellLanguageId ) ;
199199
200- return configuration . update ( settingName , newValue , global ) ;
200+ await configuration . update ( settingName , newValue , global ) ;
201201}
202202
203203function getWorkspaceSettingsWithDefaults < TSettings > (
Original file line number Diff line number Diff line change @@ -19,4 +19,14 @@ suite("Settings module", () => {
1919 assert . deepEqual ( settings . developer . featureFlags , [ ] ) ;
2020 }
2121 } ) ;
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+ } ) ;
2232} ) ;
You can’t perform that action at this time.
0 commit comments