From 2713e70563798ffdf78e3f324dd336cfa2974c9d Mon Sep 17 00:00:00 2001 From: "Bob Brown (DEVDIV)" Date: Tue, 29 Jan 2019 10:39:37 -0800 Subject: [PATCH] #3102 - fix compilerPath/compileCommands policy --- Extension/src/LanguageServer/configurations.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/configurations.ts b/Extension/src/LanguageServer/configurations.ts index 69ffbc4bb..9474e055f 100644 --- a/Extension/src/LanguageServer/configurations.ts +++ b/Extension/src/LanguageServer/configurations.ts @@ -242,7 +242,10 @@ export class CppProperties { if (isUnset(settings.defaultWindowsSdkVersion) && this.defaultWindowsSdkVersion && process.platform === 'win32') { configuration.windowsSdkVersion = this.defaultWindowsSdkVersion; } - if (isUnset(settings.defaultCompilerPath) && this.defaultCompilerPath) { + if (isUnset(settings.defaultCompilerPath) && this.defaultCompilerPath && + isUnset(settings.defaultCompileCommands) && !configuration.compileCommands) { + // compile_commands.json already specifies a compiler. compilerPath overrides the compile_commands.json compiler so + // don't set a default when compileCommands is in use. configuration.compilerPath = this.defaultCompilerPath; } if (isUnset(settings.defaultCStandard) && this.defaultCStandard) {