private updateStatus()

in Extension/src/LanguageServer/client.ts [2424:2515]


    private updateStatus(notificationBody: ReportStatusNotificationBody): void {
        const message: string = notificationBody.status;
        util.setProgress(util.getProgressExecutableSuccess());
        const testHook: TestHook = getTestHook();
        if (message.endsWith("Idle")) {
            // nothing to do
        } else if (message.endsWith("Parsing")) {
            this.model.isParsingWorkspace.Value = true;
            this.model.isParsingWorkspacePausable.Value = false;
            const status: IntelliSenseStatus = { status: Status.TagParsingBegun };
            testHook.updateStatus(status);
        } else if (message.endsWith("files")) {
            this.model.isParsingFiles.Value = true;
        } else if (message.endsWith("IntelliSense")) {
            timeStamp = Date.now();
            this.model.isUpdatingIntelliSense.Value = true;
            const status: IntelliSenseStatus = { status: Status.IntelliSenseCompiling };
            testHook.updateStatus(status);
        } else if (message.endsWith("IntelliSense done")) {
            const settings: CppSettings = new CppSettings();
            if (settings.loggingLevel === "Debug") {
                const out: logger.Logger = logger.getOutputChannelLogger();
                const duration: number = Date.now() - timeStamp;
                out.appendLine(localize("update.intellisense.time", "Update IntelliSense time (sec): {0}", duration / 1000));
            }
            this.model.isUpdatingIntelliSense.Value = false;
            const status: IntelliSenseStatus = { status: Status.IntelliSenseReady };
            testHook.updateStatus(status);
        } else if (message.endsWith("Parsing done")) { // Tag Parser Ready
            this.model.isParsingWorkspace.Value = false;
            const status: IntelliSenseStatus = { status: Status.TagParsingDone };
            testHook.updateStatus(status);
            util.setProgress(util.getProgressParseRootSuccess());
        } else if (message.endsWith("files done")) {
            this.model.isParsingFiles.Value = false;
        } else if (message.endsWith("Analysis")) {
            this.model.isRunningCodeAnalysis.Value = true;
            this.model.codeAnalysisTotal.Value = 1;
            this.model.codeAnalysisProcessed.Value = 0;
        } else if (message.endsWith("Analysis done")) {
            this.model.isRunningCodeAnalysis.Value = false;
        } else if (message.includes("Squiggles Finished - File name:")) {
            const index: number = message.lastIndexOf(":");
            const name: string = message.substring(index + 2);
            const status: IntelliSenseStatus = { status: Status.IntelliSenseReady, filename: name };
            testHook.updateStatus(status);
        } else if (message.endsWith("No Squiggles")) {
            util.setIntelliSenseProgress(util.getProgressIntelliSenseNoSquiggles());
        } else if (message.endsWith("Unresolved Headers")) {
            if (notificationBody.workspaceFolderUri) {
                const client: DefaultClient = <DefaultClient>clientCollection.getClientFor(vscode.Uri.file(notificationBody.workspaceFolderUri));
                if (!client.configuration.CurrentConfiguration?.configurationProvider) {
                    const showIntelliSenseFallbackMessage: PersistentState<boolean> = new PersistentState<boolean>("CPP.showIntelliSenseFallbackMessage", true);
                    if (showIntelliSenseFallbackMessage.Value) {
                        ui.showConfigureIncludePathMessage(async () => {
                            const configJSON: string = localize("configure.json.button", "Configure (JSON)");
                            const configUI: string = localize("configure.ui.button", "Configure (UI)");
                            const dontShowAgain: string = localize("dont.show.again", "Don't Show Again");
                            const fallbackMsg: string = client.configuration.VcpkgInstalled ?
                                localize("update.your.intellisense.settings", "Update your IntelliSense settings or use Vcpkg to install libraries to help find missing headers.") :
                                localize("configure.your.intellisense.settings", "Configure your IntelliSense settings to help find missing headers.");
                            return vscode.window.showInformationMessage(fallbackMsg, configJSON, configUI, dontShowAgain).then(async (value) => {
                                let commands: string[];
                                switch (value) {
                                    case configJSON:
                                        commands = await vscode.commands.getCommands(true);
                                        if (commands.indexOf("workbench.action.problems.focus") >= 0) {
                                            vscode.commands.executeCommand("workbench.action.problems.focus");
                                        }
                                        client.handleConfigurationEditJSONCommand();
                                        telemetry.logLanguageServerEvent("SettingsCommand", { "toast": "json" }, undefined);
                                        break;
                                    case configUI:
                                        commands = await vscode.commands.getCommands(true);
                                        if (commands.indexOf("workbench.action.problems.focus") >= 0) {
                                            vscode.commands.executeCommand("workbench.action.problems.focus");
                                        }
                                        client.handleConfigurationEditUICommand();
                                        telemetry.logLanguageServerEvent("SettingsCommand", { "toast": "ui" }, undefined);
                                        break;
                                    case dontShowAgain:
                                        showIntelliSenseFallbackMessage.Value = false;
                                        break;
                                }
                                return true;
                            });
                        }, () => showIntelliSenseFallbackMessage.Value = false);
                    }
                }
            }
        }
    }