@@ -12,10 +12,11 @@ import { suite } from 'mocha';
1212import * as vscode from 'vscode' ;
1313import * as api from 'vscode-cpptools' ;
1414import * as apit from 'vscode-cpptools/out/testApi' ;
15+ import { sleep } from '../../../../src/Utility/Async/sleep' ;
1516import { timeout } from '../../../../src/Utility/Async/timeout' ;
1617import * as testHelpers from '../../../common/testHelpers' ;
1718
18- suite ( "[Inlay hints test]" , function ( ) : void {
19+ suite ( "[Inlay hints test]" , function ( ) : void {
1920 // Settings
2021 const inlayHintSettings : vscode . WorkspaceConfiguration = vscode . workspace . getConfiguration ( 'C_Cpp.inlayHints' ) ;
2122 const autoDeclarationTypesEnabled : string = "autoDeclarationTypes.enabled" ;
@@ -41,7 +42,7 @@ suite("[Inlay hints test]", function(): void {
4142 const fileUri : vscode . Uri = vscode . Uri . file ( filePath ) ;
4243 const disposables : vscode . Disposable [ ] = [ ] ;
4344
44- suiteSetup ( async function ( ) : Promise < void > {
45+ suiteSetup ( async function ( ) : Promise < void > {
4546 await testHelpers . activateCppExtension ( ) ;
4647
4748 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 {
7475 await useDefaultSettings ( ) ;
7576 } ) ;
7677
77- suiteTeardown ( async function ( ) : Promise < void > {
78+ suiteTeardown ( async function ( ) : Promise < void > {
7879 await restoreOriginalSettings ( ) ;
7980 disposables . forEach ( d => d . dispose ( ) ) ;
8081 } ) ;
@@ -298,6 +299,9 @@ suite("[Inlay hints test]", function(): void {
298299 await inlayHintSettings . update ( inlayHintSetting , valueNew , vscode . ConfigurationTarget . Global ) ;
299300 const valueAfterChange : any = inlayHintSettings . inspect ( inlayHintSetting ) ! . globalValue ;
300301 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 ) ;
301305 }
302306 }
303307
0 commit comments