Skip to content

Commit

Permalink
Values set in settings are not immediately available for use (#12881)
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbrow authored Oct 24, 2024
1 parent e58e963 commit 5416e79
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit 5416e79

Please sign in to comment.