Skip to content

Commit 3693909

Browse files
don't squiggle for "cl.exe" or "cl" path (#7752)
1 parent 598ac0a commit 3693909

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Extension/src/LanguageServer/configurations.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,8 +1656,10 @@ export class CppProperties {
16561656
let compilerPathNeedsQuotes: boolean = false;
16571657
let compilerMessage: string | undefined;
16581658
const compilerPathAndArgs: util.CompilerPathAndArgs = util.extractCompilerPathAndArgs(compilerPath);
1659-
// Don't squiggle invalid cl.exe paths because it could be for an older preview build.
1660-
if (compilerPathAndArgs.compilerName.toLowerCase() !== "cl.exe" && compilerPathAndArgs.compilerPath !== undefined) {
1659+
const compilerLowerCase: string = compilerPathAndArgs.compilerName.toLowerCase();
1660+
const isClCompiler: boolean = compilerLowerCase === "cl" || compilerLowerCase === "cl.exe";
1661+
// Don't squiggle for invalid cl and cl.exe paths.
1662+
if (compilerPathAndArgs.compilerPath && !isClCompiler) {
16611663
// Squiggle when the compiler's path has spaces without quotes but args are used.
16621664
compilerPathNeedsQuotes = (compilerPathAndArgs.additionalArgs && compilerPathAndArgs.additionalArgs.length > 0)
16631665
&& !compilerPath.startsWith('"')
@@ -1676,7 +1678,7 @@ export class CppProperties {
16761678
}
16771679
const isWSL: boolean = isWindows && compilerPath.startsWith("/");
16781680
let compilerPathExists: boolean = true;
1679-
if (this.rootUri) {
1681+
if (this.rootUri && !isClCompiler) {
16801682
const checkPathExists: any = util.checkPathExistsSync(compilerPath, this.rootUri.fsPath + path.sep, isWindows, isWSL, true);
16811683
compilerPathExists = checkPathExists.pathExists;
16821684
compilerPath = checkPathExists.path;

0 commit comments

Comments
 (0)