From a13cc2ef5aa2019bc1a29f70a421c00e87d7c17f Mon Sep 17 00:00:00 2001 From: "Bob Brown (DEVDIV)" Date: Mon, 2 Mar 2020 11:20:32 -0800 Subject: [PATCH] Normalize all paths sent to cpptools --- src/cpptools.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cpptools.ts b/src/cpptools.ts index 3eb243d59..31c0c7f2e 100644 --- a/src/cpptools.ts +++ b/src/cpptools.ts @@ -264,13 +264,15 @@ export class CppConfigurationProvider implements cpt.CustomConfigurationProvider if (!comp_path) { throw new MissingCompilerException(); } + const normalizedCompilerPath = util.platformNormalizePath(comp_path); const flags = fileGroup.compileFlags ? [...shlex.split(fileGroup.compileFlags)] : target.compileFlags; const {standard, extraDefinitions} = parseCompileFlags(flags, lang); const defines = (fileGroup.defines || target.defines).concat(extraDefinitions); const includePath = fileGroup.includePath ? fileGroup.includePath.map(p => p.path) : target.includePath; + const normalizedIncludePath = includePath.map(p => util.platformNormalizePath(p)); const newBrowsePath = this._workspaceBrowseConfiguration.browsePath; - for (const includePathItem of includePath) { + for (const includePathItem of normalizedIncludePath) { if (newBrowsePath.indexOf(includePathItem) < 0) { newBrowsePath.push(includePathItem); } @@ -283,16 +285,16 @@ export class CppConfigurationProvider implements cpt.CustomConfigurationProvider this._workspaceBrowseConfiguration = { browsePath: newBrowsePath, standard, - compilerPath: comp_path || undefined, + compilerPath: normalizedCompilerPath || undefined, compilerArgs: flags || undefined }; return { defines, standard, - includePath, + includePath: normalizedIncludePath, intelliSenseMode: getIntelliSenseMode(comp_path), - compilerPath: comp_path || undefined, + compilerPath: normalizedCompilerPath || undefined, compilerArgs: flags || undefined }; }