Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto provider detection #10772

Merged
merged 6 commits into from
Apr 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Extension/src/LanguageServer/configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -969,10 +969,6 @@ export class CppProperties {
if (this.client.lastCustomBrowseConfigurationProviderId !== undefined) {
keepCachedBrowseConfig = configuration.configurationProvider === this.client.lastCustomBrowseConfigurationProviderId.Value;
}
} else if (this.client.lastCustomBrowseConfigurationProviderId !== undefined
&& !!this.client.lastCustomBrowseConfigurationProviderId.Value) {
// Use the last configuration provider we received a browse config from as the provider ID.
configuration.configurationProvider = this.client.lastCustomBrowseConfigurationProviderId.Value;
}
} else if (this.client.lastCustomBrowseConfigurationProviderId !== undefined) {
keepCachedBrowseConfig = configuration.configurationProvider === this.client.lastCustomBrowseConfigurationProviderId.Value;
Expand Down Expand Up @@ -1199,10 +1195,7 @@ export class CppProperties {
return; // Occurs when propertiesFile hasn't been checked yet.
}
this.configFileWatcherFallbackTime = new Date();
if (this.propertiesFile) {
this.parsePropertiesFile();
// parsePropertiesFile can fail, but it won't overwrite an existing configurationJson in the event of failure.
// this.configurationJson should only be undefined here if we have never successfully parsed the propertiesFile.
if (this.parsePropertiesFile()) {
if (this.configurationJson) {
if (this.CurrentConfigurationIndex < 0 ||
this.CurrentConfigurationIndex >= this.configurationJson.configurations.length) {
Expand Down Expand Up @@ -1269,6 +1262,7 @@ export class CppProperties {

private parsePropertiesFile(): boolean {
if (!this.propertiesFile) {
this.configurationJson = undefined;
return false;
}
let success: boolean = true;
Expand Down