@@ -254,7 +254,7 @@ export class CppProperties {
254254 // to the language server until the default include paths and frameworks have been sent.
255255
256256 const configFilePath : string = path . join ( this . configFolder , "c_cpp_properties.json" ) ;
257- if ( this . rootUri !== null && fs . existsSync ( configFilePath ) ) {
257+ if ( this . rootUri !== null && util . checkFileExistsSync ( configFilePath ) ) {
258258 this . propertiesFile = vscode . Uri . file ( configFilePath ) ;
259259 } else {
260260 this . propertiesFile = null ;
@@ -481,9 +481,9 @@ export class CppProperties {
481481 list . forEach ( ( entry ) => {
482482 if ( entry !== "vcpkg" ) {
483483 const pathToCheck : string = path . join ( vcpkgRoot , entry ) ;
484- if ( fs . existsSync ( pathToCheck ) ) {
484+ if ( util . checkDirectoryExistsSync ( pathToCheck ) ) {
485485 let p : string = path . join ( pathToCheck , "include" ) ;
486- if ( fs . existsSync ( p ) ) {
486+ if ( util . checkDirectoryExistsSync ( p ) ) {
487487 p = p . replace ( / \\ / g, "/" ) ;
488488 p = p . replace ( vcpkgRoot , "${vcpkgRoot}" ) ;
489489 this . vcpkgIncludes . push ( p ) ;
@@ -1171,7 +1171,7 @@ export class CppProperties {
11711171 this . configurationJson . configurations . forEach ( c => {
11721172 c . compileCommands ?. forEach ( ( path : string ) => {
11731173 const compileCommandsFile : string = this . resolvePath ( path ) ;
1174- if ( fs . existsSync ( compileCommandsFile ) ) {
1174+ if ( util . checkFileExistsSync ( compileCommandsFile ) ) {
11751175 filePaths . add ( compileCommandsFile ) ;
11761176 }
11771177 } ) ;
@@ -1672,10 +1672,10 @@ export class CppProperties {
16721672 if ( ! isCl && compilerPathAndArgs . compilerPath ) {
16731673 const compilerPathMayNeedQuotes : boolean = ! resolvedCompilerPath . startsWith ( '"' ) && resolvedCompilerPath . includes ( " " ) && compilerPathAndArgs . compilerArgsFromCommandLineInPath . length > 0 ;
16741674 let pathExists : boolean = true ;
1675- const existsWithExeAdded : ( path : string ) => boolean = ( path : string ) => isWindows && ! path . startsWith ( "/" ) && fs . existsSync ( path + ".exe" ) ;
1675+ const existsWithExeAdded : ( path : string ) => boolean = ( path : string ) => isWindows && ! path . startsWith ( "/" ) && util . checkFileExistsSync ( path + ".exe" ) ;
16761676
16771677 resolvedCompilerPath = compilerPathAndArgs . compilerPath ;
1678- if ( ! fs . existsSync ( resolvedCompilerPath ) ) {
1678+ if ( ! util . checkFileExistsSync ( resolvedCompilerPath ) ) {
16791679 if ( existsWithExeAdded ( resolvedCompilerPath ) ) {
16801680 resolvedCompilerPath += ".exe" ;
16811681 } else {
@@ -1686,7 +1686,7 @@ export class CppProperties {
16861686 } else if ( rootUri ) {
16871687 // Test if it was a relative path.
16881688 const absolutePath : string = rootUri . fsPath + path . sep + resolvedCompilerPath ;
1689- if ( ! fs . existsSync ( absolutePath ) ) {
1689+ if ( ! util . checkFileExistsSync ( absolutePath ) ) {
16901690 if ( existsWithExeAdded ( absolutePath ) ) {
16911691 resolvedCompilerPath = absolutePath + ".exe" ;
16921692 } else {
0 commit comments