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

Fix #59862

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