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

Values set in settings are not immediately available for use after changing them #12881

Merged
merged 1 commit into from
Oct 24, 2024
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
9 changes: 5 additions & 4 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ export class DefaultClient implements Client {
if (index === paths.length - 1) {
action = "disable";
settings.defaultCompilerPath = "";
await this.configuration.updateCompilerPathIfSet(settings.defaultCompilerPath);
await this.configuration.updateCompilerPathIfSet("");
configurationSelected = true;
await this.showPrompt(sender);
return ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompilerPath, "disablePrompt");
Expand All @@ -1066,7 +1066,7 @@ export class DefaultClient implements Client {
configurationSelected = true;
action = "compiler browsed";
settings.defaultCompilerPath = result[0].fsPath;
await this.configuration.updateCompilerPathIfSet(settings.defaultCompilerPath);
await this.configuration.updateCompilerPathIfSet(result[0].fsPath);
void SessionState.trustedCompilerFound.set(true);
} else {
configurationSelected = true;
Expand All @@ -1084,8 +1084,9 @@ export class DefaultClient implements Client {
return ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.CompileCommands, showButtonSender);
} else {
action = "select compiler";
settings.defaultCompilerPath = util.isCl(paths[index]) ? "cl.exe" : paths[index];
await this.configuration.updateCompilerPathIfSet(settings.defaultCompilerPath);
const newCompiler: string = util.isCl(paths[index]) ? "cl.exe" : paths[index];
settings.defaultCompilerPath = newCompiler;
await this.configuration.updateCompilerPathIfSet(newCompiler);
void SessionState.trustedCompilerFound.set(true);
}
}
Expand Down
Loading