From 8ac65e65b5df60864a324c1ddbea713e4cbcd279 Mon Sep 17 00:00:00 2001 From: Colen Garoutte-Carson <49173979+Colengms@users.noreply.github.com> Date: Thu, 15 Oct 2020 17:55:42 -0700 Subject: [PATCH] Only show warning channel the first time populated (#6330) --- Extension/src/LanguageServer/client.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index 8bcf922288..886b97d478 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -130,12 +130,17 @@ function showMessageWindow(params: ShowMessageWindowParams): void { function showWarning(params: ShowWarningParams): void { const message: string = util.getLocalizedString(params.localizeStringParams); + let showChannel: boolean = false; if (!warningChannel) { warningChannel = vscode.window.createOutputChannel(`${localize("c.cpp.warnings", "C/C++ Configuration Warnings")}`); workspaceDisposables.push(warningChannel); + showChannel = true; } + // Append before showing the channel, to avoid a delay. warningChannel.appendLine(`[${new Date().toLocaleString()}] ${message}`); - warningChannel.show(true); + if (showChannel) { + warningChannel.show(true); + } } function publishDiagnostics(params: PublishDiagnosticsParams): void {