Compare commits

...
2 changed files with 9 additions and 11 deletions
+9 -6
View File
@@ -2688,7 +2688,7 @@ export class DefaultClient implements Client {
const configurationNotSet: boolean = configProviderNotSetAndNoCache && compileCommandsNotSet && compilerPathNotSet;
showConfigStatus = showConfigStatus || (configurationNotSet &&
!!compilerDefaults && !compilerDefaults.trustedCompilerFound && trustedCompilerPaths && (trustedCompilerPaths.length !== 1 || trustedCompilerPaths[0] !== ""));
!!compilerDefaults && !compilerDefaults.trustedCompilerFound && (trustedCompilerPaths.length !== 1 || trustedCompilerPaths[0] !== ""));
const configProviderType: ConfigurationType = this.configuration.ConfigProviderAutoSelected ? ConfigurationType.AutoConfigProvider : ConfigurationType.ConfigProvider;
const compilerType: ConfigurationType = this.configuration.CurrentConfiguration?.compilerPathIsExplicit ? ConfigurationType.CompilerPath : ConfigurationType.AutoCompilerPath;
@@ -2905,6 +2905,11 @@ export class DefaultClient implements Client {
params.configurations.push(modifiedConfig);
});
const trusted_compiler_path: string | undefined = params.configurations[params.currentConfiguration].compilerPath;
if (trusted_compiler_path) {
void this.addTrustedCompiler(trusted_compiler_path).catch(logAndReturn.undefined);
}
await this.languageClient.sendRequest(ChangeCppPropertiesRequest, params);
if (!!this.lastCustomBrowseConfigurationProviderId && !!this.lastCustomBrowseConfiguration && !!this.lastCustomBrowseConfigurationProviderVersion) {
if (!this.doneInitialCustomBrowseConfigurationCheck) {
@@ -3870,13 +3875,11 @@ export class DefaultClient implements Client {
if (path === null || path === undefined) {
return;
}
if (trustedCompilerPaths.includes(path)) {
DebugConfigurationProvider.ClearDetectedBuildTasks();
return;
if (!trustedCompilerPaths.includes(path)) {
trustedCompilerPaths.push(path);
}
trustedCompilerPaths.push(path);
compilerDefaults = await this.requestCompiler(path);
DebugConfigurationProvider.ClearDetectedBuildTasks();
compilerDefaults = await this.requestCompiler(path);
}
}
@@ -976,11 +976,6 @@ export class CppProperties {
configuration.macFrameworkPath = this.defaultFrameworks;
}
}
} else {
// add compiler to list of trusted compilers
if (i === this.CurrentConfigurationIndex) {
void this.client.addTrustedCompiler(configuration.compilerPath).catch(logAndReturn.undefined);
}
}
} else {
// However, if compileCommands are used and compilerPath is explicitly set, it's still necessary to resolve variables in it.