@@ -12,10 +12,11 @@ import { suite } from 'mocha';
12
12
import * as vscode from 'vscode' ;
13
13
import * as api from 'vscode-cpptools' ;
14
14
import * as apit from 'vscode-cpptools/out/testApi' ;
15
+ import { sleep } from '../../../../src/Utility/Async/sleep' ;
15
16
import { timeout } from '../../../../src/Utility/Async/timeout' ;
16
17
import * as testHelpers from '../../../common/testHelpers' ;
17
18
18
- suite ( "[Inlay hints test]" , function ( ) : void {
19
+ suite ( "[Inlay hints test]" , function ( ) : void {
19
20
// Settings
20
21
const inlayHintSettings : vscode . WorkspaceConfiguration = vscode . workspace . getConfiguration ( 'C_Cpp.inlayHints' ) ;
21
22
const autoDeclarationTypesEnabled : string = "autoDeclarationTypes.enabled" ;
@@ -41,7 +42,7 @@ suite("[Inlay hints test]", function(): void {
41
42
const fileUri : vscode . Uri = vscode . Uri . file ( filePath ) ;
42
43
const disposables : vscode . Disposable [ ] = [ ] ;
43
44
44
- suiteSetup ( async function ( ) : Promise < void > {
45
+ suiteSetup ( async function ( ) : Promise < void > {
45
46
await testHelpers . activateCppExtension ( ) ;
46
47
47
48
const cpptools = await apit . getCppToolsTestApi ( api . Version . latest ) ?? assert . fail ( "Could not get cpptools test api" ) ;
@@ -74,7 +75,7 @@ suite("[Inlay hints test]", function(): void {
74
75
await useDefaultSettings ( ) ;
75
76
} ) ;
76
77
77
- suiteTeardown ( async function ( ) : Promise < void > {
78
+ suiteTeardown ( async function ( ) : Promise < void > {
78
79
await restoreOriginalSettings ( ) ;
79
80
disposables . forEach ( d => d . dispose ( ) ) ;
80
81
} ) ;
@@ -298,6 +299,9 @@ suite("[Inlay hints test]", function(): void {
298
299
await inlayHintSettings . update ( inlayHintSetting , valueNew , vscode . ConfigurationTarget . Global ) ;
299
300
const valueAfterChange : any = inlayHintSettings . inspect ( inlayHintSetting ) ! . globalValue ;
300
301
assert . strictEqual ( valueAfterChange , valueNew , `Unable to change setting: ${ inlayHintSetting } ` ) ;
302
+ // TODO: We need a way to synchronize with native process having completely processed the setting change
303
+ // and any changes in behavior being fully applied.
304
+ await sleep ( 5000 ) ;
301
305
}
302
306
}
303
307
0 commit comments