You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My use case is the following one:
I want to logs information in a dedicated channel of the output console, but by default I don't want to show the output console. Then I add logs inside my channel.
But when I want to see the output console, the channel is available and seems selected , but I need to select the channel again in the pick list to see the logs.
Steps to Reproduce:
Create an outputchannel but don't use the channel.show().
Add logs in this channel.
Open the output console, the channel seems selected but the logs are not visible.
What I can see is that the output widget is not refreshed for the following events : onSelectedChannelChanged
onChannelAdded
But only on onChannelWasHidden
onChannelWasShown
I corrected the code of OutputChannelManager and OutputWidget to make it work. But I'm not so sure about all the side effects :
getChannel(name: string): OutputChannel {
const existing = this.channels.get(name);
if (existing) {
return existing;
}
// We have to register the resource first, because `textModelService#createModelReference` will require it
// right after creating the monaco.editor.ITextModel.
// All `append` and `appendLine` will be deferred until the underlying text-model instantiation.
let resource = this.resources.get(name);
if (!resource) {
const uri = OutputUri.create(name);
const editorModelRef = new Deferred<IReference<MonacoEditorModel>>();
resource = this.createResource({ uri, editorModelRef });
this.resources.set(name, resource);
this.textModelService.createModelReference(uri).then(ref => editorModelRef.resolve(ref));
}
const channel = this.createChannel(resource);
this.channels.set(name, channel);
this.toDisposeOnChannelDeletion.set(name, this.registerListeners(channel));
if (!this.selectedChannel) {
this.selectedChannel = channel;
}
this.channelAddedEmitter.fire(channel);
return channel;
}
Here I moved the this.channelAddedEmitter.fire(channel) after the this.selectedChannel = channel; to be sure that the widget has the right channel to manage.
And for the init of OutputWidget , I added the listener of channel added :
Make sure the output widget is refreshed even if the channel.show() function is not used if there is only one channel.
Contributed by STMicroelectronics
Bug Description:
My use case is the following one:
I want to logs information in a dedicated channel of the output console, but by default I don't want to show the output console. Then I add logs inside my channel.
But when I want to see the output console, the channel is available and seems selected , but I need to select the channel again in the pick list to see the logs.
Steps to Reproduce:
What I can see is that the output widget is not refreshed for the following events :
onSelectedChannelChanged
onChannelAdded
But only on
onChannelWasHidden
onChannelWasShown
I corrected the code of OutputChannelManager and OutputWidget to make it work. But I'm not so sure about all the side effects :
Here I moved the this.channelAddedEmitter.fire(channel) after the this.selectedChannel = channel; to be sure that the widget has the right channel to manage.
And for the init of OutputWidget , I added the listener of channel added :
What is your view on it ?
I can provide the PR if needed.
Additional Information
The text was updated successfully, but these errors were encountered: