Skip to content

Commit 38e0744

Browse files
authored
Fix warning "Cannot find" instead of "Path is not a file" for compilerPath. (#14265)
1 parent a651e53 commit 38e0744

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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("/") && util.checkFileExistsSync(path + ".exe");
1675+
const existsWithExeAdded: (path: string) => boolean = (path: string) => isWindows && !path.startsWith("/") && fs.existsSync(path + ".exe");
16761676

16771677
resolvedCompilerPath = compilerPathAndArgs.compilerPath;
1678-
if (!util.checkFileExistsSync(resolvedCompilerPath)) {
1678+
if (!fs.existsSync(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 (!util.checkFileExistsSync(absolutePath)) {
1689+
if (!fs.existsSync(absolutePath)) {
16901690
if (existsWithExeAdded(absolutePath)) {
16911691
resolvedCompilerPath = absolutePath + ".exe";
16921692
} else {

0 commit comments

Comments
 (0)