Skip to content

Commit

Permalink
created issue specific solution before full compilerFragments enhance…
Browse files Browse the repository at this point in the history
…ment
  • Loading branch information
snehara99 committed Dec 9, 2024
1 parent a123cce commit cf80743
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Empty file modified assets/parseCompilerArgs.sh
100644 → 100755
Empty file.
24 changes: 15 additions & 9 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1213,18 +1213,24 @@ export async function parseCustomConfigProvider(
// and switches that don't affect IntelliSense but are causing errors.
let compilerArgs: string[] = [];
let compilerFragments: string[] = [];

if (useCompilerFragments) {
compilerFragments = await parseAnySwitchFromToolArguments(
compilerTool.arguments,
["I", "FI", "include", "D", "std", "MF"]
);
} else {
compilerArgs = await parseAnySwitchFromToolArguments(
compilerTool.arguments,
["I", "FI", "include", "D", "std", "MF"]
);
// This is a temporary solution where we are only using compiler fragments here to pass the
// -D defines to the compiler (to fix intellisense issues). We still separately parse defines.
// There is still an issue tracking using compilerFragments fully instead of compilerArgs:
// https://github.com/microsoft/vscode-makefile-tools/issues/352.
let tempFragments: string[] = compilerTool.arguments.trim().split(" -D");
if (tempFragments.length > 1) {
for (let i: number = 1; i < tempFragments.length; i++) {
compilerFragments.push("-D" + tempFragments[i].trim().split("/\s+/")[0]);
}
}
}

compilerArgs = await parseAnySwitchFromToolArguments(
compilerTool.arguments,
["I", "FI", "include", "D", "std", "MF"]
);

// Parse and log the includes, forced includes and the defines
let includes: string[] = parseMultipleSwitchFromToolArguments(
Expand Down

0 comments on commit cf80743

Please sign in to comment.