提交 3cd0a546 编写于 作者: S Sandeep Somavarapu

Fix #59862

上级 0c43f4ef
......@@ -157,7 +157,8 @@ export class SwitchOutputActionItem extends SelectActionItem {
if (selectedChannel) {
selected = this.outputChannels.map(c => c.id).indexOf(selectedChannel);
if (selected === -1) {
selected = separatorIndex + 1 + this.logChannels.map(c => c.id).indexOf(selectedChannel);
const logChannelIndex = this.logChannels.map(c => c.id).indexOf(selectedChannel);
selected = logChannelIndex !== -1 ? separatorIndex + 1 + logChannelIndex : 0;
}
}
this.setOptions(options, Math.max(0, selected), separatorIndex !== -1 ? separatorIndex : void 0);
......
......@@ -73,7 +73,7 @@ interface OutputChannel extends IOutputChannel {
loadModel(): TPromise<ITextModel>;
}
abstract class AbstractFileOutputChannel extends Disposable {
abstract class AbstractFileOutputChannel extends Disposable implements OutputChannel {
scrollLock: boolean = false;
......@@ -152,6 +152,9 @@ abstract class AbstractFileOutputChannel extends Disposable {
}
}
abstract loadModel(): TPromise<ITextModel>;
abstract append(message: string);
protected onModelCreated(model: ITextModel) { }
protected onModelWillDispose(model: ITextModel) { }
protected onUpdateModelCancelled() { }
......@@ -560,16 +563,17 @@ export class OutputService extends Disposable implements IOutputService, ITextMo
}
}, channelDisposables);
channel.onDispose(() => {
Registry.as<IOutputChannelRegistry>(Extensions.OutputChannels).removeChannel(id);
if (this.activeChannel === channel) {
const channels = this.getChannelDescriptors();
if (this.isPanelShown() && channels.length) {
this.doShowChannel(this.getChannel(channels[0].id), true);
this._onActiveOutputChannel.fire(channels[0].id);
const channel = channels.length ? this.getChannel(channels[0].id) : null;
if (channel && this.isPanelShown()) {
this.showChannel(channel.id, true);
} else {
this._onActiveOutputChannel.fire(void 0);
this.activeChannel = channel;
this._onActiveOutputChannel.fire(channel ? channel.id : void 0);
}
}
Registry.as<IOutputChannelRegistry>(Extensions.OutputChannels).removeChannel(id);
dispose(channelDisposables);
}, channelDisposables);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册