Skip to content

Commit 913ddf4

Browse files
authored
Fix incorrect compiler path with spaces and args squiggle. (#5217)
* Fix invalid `c_cpp_properties.json` and configuration UI warning `Compiler path with spaces and arguments is missing double quotes`.
1 parent eba352e commit 913ddf4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Extension/src/LanguageServer/configurations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ export class CppProperties {
10361036
// Error when the compiler's path has spaces without quotes but args are used.
10371037
// Except, exclude cl.exe paths because it could be for an older preview build.
10381038
let compilerPathNeedsQuotes: boolean =
1039-
compilerPathAndArgs.additionalArgs &&
1039+
(compilerPathAndArgs.additionalArgs && compilerPathAndArgs.additionalArgs.length > 0) &&
10401040
!resolvedCompilerPath.startsWith('"') &&
10411041
compilerPathAndArgs.compilerPath !== undefined &&
10421042
compilerPathAndArgs.compilerPath.includes(" ");
@@ -1315,7 +1315,7 @@ export class CppProperties {
13151315
continue;
13161316
}
13171317
// Squiggle when the compiler's path has spaces without quotes but args are used.
1318-
compilerPathNeedsQuotes = compilerPathAndArgs.additionalArgs
1318+
compilerPathNeedsQuotes = (compilerPathAndArgs.additionalArgs && compilerPathAndArgs.additionalArgs.length > 0)
13191319
&& !resolvedPath.startsWith('"')
13201320
&& compilerPathAndArgs.compilerPath.includes(" ");
13211321
resolvedPath = compilerPathAndArgs.compilerPath;

0 commit comments

Comments
 (0)