Skip to content

Commit 8ac65e6

Browse files
authored
Only show warning channel the first time populated (#6330)
1 parent 2ec525e commit 8ac65e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Extension/src/LanguageServer/client.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,17 @@ function showMessageWindow(params: ShowMessageWindowParams): void {
130130

131131
function showWarning(params: ShowWarningParams): void {
132132
const message: string = util.getLocalizedString(params.localizeStringParams);
133+
let showChannel: boolean = false;
133134
if (!warningChannel) {
134135
warningChannel = vscode.window.createOutputChannel(`${localize("c.cpp.warnings", "C/C++ Configuration Warnings")}`);
135136
workspaceDisposables.push(warningChannel);
137+
showChannel = true;
136138
}
139+
// Append before showing the channel, to avoid a delay.
137140
warningChannel.appendLine(`[${new Date().toLocaleString()}] ${message}`);
138-
warningChannel.show(true);
141+
if (showChannel) {
142+
warningChannel.show(true);
143+
}
139144
}
140145

141146
function publishDiagnostics(params: PublishDiagnosticsParams): void {

0 commit comments

Comments
 (0)