Skip to content

Commit

Permalink
Only show warning channel the first time populated (#6330)
Browse files Browse the repository at this point in the history
  • Loading branch information
Colengms authored Oct 16, 2020
1 parent 2ec525e commit 8ac65e6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8ac65e6

Please sign in to comment.