File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Extension/src/LanguageServer Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -130,12 +130,17 @@ function showMessageWindow(params: ShowMessageWindowParams): void {
130130
131131function 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
141146function publishDiagnostics ( params : PublishDiagnosticsParams ) : void {
You can’t perform that action at this time.
0 commit comments