diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 5f43018b3..786963fce 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1779,6 +1779,10 @@ export class DefaultClient implements Client { }); } + if (changedSettings['codeAnalysis.runAutomatically'] !== undefined || changedSettings['codeAnalysis.clangTidy.enabled'] !== undefined) { + ui.refreshCodeAnalysisText(this.model.isRunningCodeAnalysis.Value); + } + const showButtonSender: string = "settingsChanged"; if (changedSettings["default.configurationProvider"] !== undefined) { void ui.ShowConfigureIntelliSenseButton(false, this, ConfigurationType.ConfigProvider, showButtonSender); diff --git a/Extension/src/LanguageServer/ui.ts b/Extension/src/LanguageServer/ui.ts index 056645a29..bd976ed8b 100644 --- a/Extension/src/LanguageServer/ui.ts +++ b/Extension/src/LanguageServer/ui.ts @@ -200,8 +200,8 @@ export class LanguageStatusUI { if (this.isParsingWorkspacePaused) { const displayTwoStatus: boolean = this.isParsingFiles && this.isParsingWorkspace; return (this.isParsingFiles ? this.parsingFilesTooltip : "") - + (displayTwoStatus ? " | " : "") - + (this.isParsingWorkspace ? this.workspaceParsingPausedText : ""); + + (displayTwoStatus ? " | " : "") + + (this.isParsingWorkspace ? this.workspaceParsingPausedText : ""); } else { return this.isParsingWorkspace ? this.workspaceParsingRunningText : this.parsingFilesTooltip; } @@ -260,6 +260,13 @@ export class LanguageStatusUI { }; return item; } + + public refreshCodeAnalysisText(isRunningCodeAnalysis: boolean) { + const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText; + const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode(); + this.codeAnalysisStatusItem.text = isRunningCodeAnalysis ? activeText : idleText; + } + private setIsCodeAnalysisPaused(val: boolean): void { if (!this.isRunningCodeAnalysis) { return; @@ -286,9 +293,7 @@ export class LanguageStatusUI { } this.isRunningCodeAnalysis = val; this.codeAnalysisStatusItem.busy = val; - const activeText: string = this.isCodeAnalysisPaused ? this.codeAnalysisPausedText : this.codeAnalysisRunningText; - const idleText: string = this.codeAnalysisModePrefix + this.codeAnalysisCurrentMode(); - this.codeAnalysisStatusItem.text = val ? activeText : idleText; + this.refreshCodeAnalysisText(val); this.codeAnalysisStatusItem.command = val ? { command: "C_Cpp.ShowActiveCodeAnalysisCommands", title: localize("c.cpp.codeanalysis.statusbar.showCodeAnalysisOptions", "Options"), @@ -497,7 +502,7 @@ export class LanguageStatusUI { // TODO: Check some "AlwaysShow" setting here. this.ShowConfiguration = isCppOrRelated || (util.getWorkspaceIsCpp() && (activeEditor.document.fileName.endsWith("tasks.json") || - activeEditor.document.fileName.endsWith("launch.json"))); + activeEditor.document.fileName.endsWith("launch.json"))); if (this.showConfigureIntelliSenseButton) { if (isCppOrRelated && !!this.currentClient && this.currentClient.getShowConfigureIntelliSenseButton()) {