diff --git a/src/vs/workbench/parts/extensions/common/extensions.ts b/src/vs/workbench/parts/extensions/common/extensions.ts index 1bd12d9efb6aae31135a7ebfaa1fb0478c0811c2..4979e86d55cf59644141baae95a6f8736005377b 100644 --- a/src/vs/workbench/parts/extensions/common/extensions.ts +++ b/src/vs/workbench/parts/extensions/common/extensions.ts @@ -84,4 +84,5 @@ export interface IExtensionTipsService { getRecommendations(): TPromise; } -export const ExtensionsLabel = nls.localize('extensions', "Extensions"); \ No newline at end of file +export const ExtensionsLabel = nls.localize('extensions', "Extensions"); +export const ExtensionsChannelId = 'extensions'; \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts index 626715f89f23e761adec02093f6eefa61a316003..b0374e2c5388abd08d4b6cfd83a1361919d27648 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts @@ -8,7 +8,7 @@ import { Registry } from 'vs/platform/platform'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IStatusbarRegistry, Extensions as StatusbarExtensions, StatusbarItemDescriptor, StatusbarAlignment } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { ExtensionsStatusbarItem } from 'vs/workbench/parts/extensions/electron-browser/extensionsWidgets'; -import { IGalleryService, ExtensionsLabel } from 'vs/workbench/parts/extensions/common/extensions'; +import { IGalleryService, ExtensionsLabel, ExtensionsChannelId } from 'vs/workbench/parts/extensions/common/extensions'; import { GalleryService } from 'vs/workbench/parts/extensions/common/vsoGalleryService'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { ExtensionsWorkbenchExtension } from 'vs/workbench/parts/extensions/electron-browser/extensionsWorkbenchExtension'; @@ -23,4 +23,4 @@ Registry.as(StatusbarExtensions.Statusbar) .registerStatusbarItem(new StatusbarItemDescriptor(ExtensionsStatusbarItem, StatusbarAlignment.LEFT,10000)); Registry.as(OutputExtensions.OutputChannels) - .registerChannel(ExtensionsLabel); \ No newline at end of file + .registerChannel(ExtensionsChannelId, ExtensionsLabel); \ No newline at end of file diff --git a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts index b6f78d7926c85665293e1907094b34629eaa8967..4fc09ccb3786d995aed39262b732da01bde0d489 100644 --- a/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts +++ b/src/vs/workbench/parts/git/browser/gitWorkbenchContributions.ts @@ -452,7 +452,7 @@ export function registerContributions(): void { // Register Output Channel var outputChannelRegistry = platform.Registry.as(output.Extensions.OutputChannels); - outputChannelRegistry.registerChannel('Git'); + outputChannelRegistry.registerChannel('git', nls.localize('git', "Git")); // Register Git Output (platform.Registry.as(ext.Extensions.Workbench)).registerWorkbenchContribution( diff --git a/src/vs/workbench/parts/output/browser/outputActions.ts b/src/vs/workbench/parts/output/browser/outputActions.ts index 95e8b1a72f20287e92928be54632dd2e27f295f1..edffd00d6d916f11ead80ba32636aa6e78e362b2 100644 --- a/src/vs/workbench/parts/output/browser/outputActions.ts +++ b/src/vs/workbench/parts/output/browser/outputActions.ts @@ -123,7 +123,7 @@ export class SwitchOutputActionItem extends SelectActionItem { } private static getChannels(outputService: IOutputService): string[] { - const contributedChannels = (Registry.as(Extensions.OutputChannels)).getChannels(); + const contributedChannels = (Registry.as(Extensions.OutputChannels)).getChannels().map(channelData => channelData.id); const usedChannels = outputService.getChannels(); return arrays.distinct(contributedChannels.concat(usedChannels)).sort(); // sort by name diff --git a/src/vs/workbench/parts/output/common/output.ts b/src/vs/workbench/parts/output/common/output.ts index 8a1d82a2e7f6ad65d9299622457449140cc1cd5b..7ba81777a682034674739458d7d0a5dd0edeeee8 100644 --- a/src/vs/workbench/parts/output/common/output.ts +++ b/src/vs/workbench/parts/output/common/output.ts @@ -108,35 +108,40 @@ export interface IOutputService { onActiveOutputChannel: Event; } +export interface IOutputChannel { + + +} + export interface IOutputChannelRegistry { /** * Make an output channel known to the output world. */ - registerChannel(name: string): void; + registerChannel(id: string, name: string): void; /** * Returns the list of channels known to the output world. */ - getChannels(): string[]; + getChannels(): { id: string, displayName: string}[]; } class OutputChannelRegistry implements IOutputChannelRegistry { - private channels: string[]; + private channels: { id: string, displayName: string }[]; constructor() { this.channels = []; } - public registerChannel(name: string): void { - if (this.channels.indexOf(name) === -1) { - this.channels.push(name); + public registerChannel(id: string, displayName: string): void { + if (this.channels.every(channel => channel.id !== id)) { + this.channels.push({ id, displayName }); } } - public getChannels(): string[] { - return this.channels.slice(0); + public getChannels(): { id: string, displayName: string}[] { + return this.channels; } } -Registry.add(Extensions.OutputChannels, new OutputChannelRegistry()); \ No newline at end of file +Registry.add(Extensions.OutputChannels, new OutputChannelRegistry()); diff --git a/src/vs/workbench/parts/output/common/outputServices.ts b/src/vs/workbench/parts/output/common/outputServices.ts index ff6d5cf2fa45e687b6a1e8c6894cf18010d31e28..0b8d27aae92e2097856ff67efdae8de9033f8637 100644 --- a/src/vs/workbench/parts/output/common/outputServices.ts +++ b/src/vs/workbench/parts/output/common/outputServices.ts @@ -25,7 +25,7 @@ export class OutputService implements IOutputService { private receivedOutput: { [channel: string]: string; }; - private activeChannel: string; + private activeChannelId: string; private _onOutput: Emitter; private _onOutputChannel: Emitter; @@ -45,7 +45,7 @@ export class OutputService implements IOutputService { this.receivedOutput = Object.create(null); const channels = (Registry.as(Extensions.OutputChannels)).getChannels(); - this.activeChannel = this.storageService.get(OUTPUT_ACTIVE_CHANNEL_KEY, StorageScope.WORKSPACE, channels && channels.length > 0 ? channels[0] : null); + this.activeChannelId = this.storageService.get(OUTPUT_ACTIVE_CHANNEL_KEY, StorageScope.WORKSPACE, channels && channels.length > 0 ? channels[0].id : null); } public get onOutput(): Event { @@ -89,7 +89,7 @@ export class OutputService implements IOutputService { } public getActiveChannel(): string { - return this.activeChannel; + return this.activeChannelId; } public clearOutput(channel: string): void { @@ -100,12 +100,12 @@ export class OutputService implements IOutputService { public showOutput(channel: string, preserveFocus?: boolean): TPromise { const panel = this.panelService.getActivePanel(); - if (this.activeChannel === channel && panel && panel.getId() === OUTPUT_PANEL_ID) { + if (this.activeChannelId === channel && panel && panel.getId() === OUTPUT_PANEL_ID) { return TPromise.as(panel); } - this.activeChannel = channel; - this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, this.activeChannel, StorageScope.WORKSPACE); + this.activeChannelId = channel; + this.storageService.store(OUTPUT_ACTIVE_CHANNEL_KEY, this.activeChannelId, StorageScope.WORKSPACE); this._onActiveOutputChannel.fire(channel); // emit event that a new channel is active return this.panelService.openPanel(OUTPUT_PANEL_ID, !preserveFocus).then((outputPanel: OutputPanel) => { diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 9fc3bab33df8c96e635dc99691791e2e6f03cddb..86288ce4886aaf1c4102a81fd792c49b8e45ed59 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -452,7 +452,8 @@ interface TaskServiceEventData { class TaskService extends EventEmitter implements ITaskService { public serviceId = ITaskService; public static SERVICE_ID: string = 'taskService'; - public static OutputChannel:string = 'Tasks'; + public static OutputChannel:string = 'tasks'; + public static OutputChannelLabel:string = nls.localize('tasks', "Tasks"); private modeService: IModeService; private configurationService: IConfigurationService; @@ -831,7 +832,7 @@ if (Env.enableTasks) { // Output channel let outputChannelRegistry = Registry.as(OutputExt.OutputChannels); - outputChannelRegistry.registerChannel(TaskService.OutputChannel); + outputChannelRegistry.registerChannel(TaskService.OutputChannel, TaskService.OutputChannelLabel); (Registry.as(WorkbenchExtensions.Workbench)).registerWorkbenchContribution(TaskServiceParticipant);