diff --git a/src/vs/workbench/api/browser/mainThreadOutputService.ts b/src/vs/workbench/api/browser/mainThreadOutputService.ts index 9eb8abcdfa88c79c60ca4310e38928ad3bed6b57..57930adeddc3a1a48b0efbbf96b4bf852963eceb 100644 --- a/src/vs/workbench/api/browser/mainThreadOutputService.ts +++ b/src/vs/workbench/api/browser/mainThreadOutputService.ts @@ -4,7 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { Registry } from 'vs/platform/registry/common/platform'; -import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID, Extensions, IOutputChannelRegistry } from 'vs/workbench/contrib/output/common/output'; +import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID } from 'vs/workbench/contrib/output/common/output'; +import { Extensions, IOutputChannelRegistry } from 'vs/workbench/services/output/common/output'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { MainThreadOutputServiceShape, MainContext, IExtHostContext, ExtHostOutputServiceShape, ExtHostContext } from '../common/extHost.protocol'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts index e1527477edda7e4f1e1abe8c909b08fccabf3745..a083e174f821d4ea7ae5250c1c908ae5a70f3c69 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts @@ -12,7 +12,7 @@ import { ExtensionsLabel, ExtensionsChannelId, PreferencesLabel, IExtensionManag import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/workbench/services/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/services/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { VIEWLET_ID, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService'; diff --git a/src/vs/workbench/contrib/logs/common/logs.contribution.ts b/src/vs/workbench/contrib/logs/common/logs.contribution.ts index 09b25d44c9191a28205a52e8c759f87f156b5766..70b5d4588027df1fde72ed3c7bdc59861f062aa4 100644 --- a/src/vs/workbench/contrib/logs/common/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/common/logs.contribution.ts @@ -14,7 +14,7 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; import { IFileService, FileChangeType, whenProviderRegistered } from 'vs/platform/files/common/files'; import { URI } from 'vs/base/common/uri'; -import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output'; import { Disposable } from 'vs/base/common/lifecycle'; import { ILogService, LogLevel } from 'vs/platform/log/common/log'; import { dirname } from 'vs/base/common/resources'; diff --git a/src/vs/workbench/contrib/output/browser/logViewer.ts b/src/vs/workbench/contrib/output/browser/logViewer.ts index e1f3a1fd3b49ea92ffb161cc4bf4499a68603471..4dba3a914e74bcfeee6094833141aa3f692d1d2e 100644 --- a/src/vs/workbench/contrib/output/browser/logViewer.ts +++ b/src/vs/workbench/contrib/output/browser/logViewer.ts @@ -14,7 +14,8 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { URI } from 'vs/base/common/uri'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; -import { LOG_SCHEME, IFileOutputChannelDescriptor } from 'vs/workbench/contrib/output/common/output'; +import { LOG_SCHEME } from 'vs/workbench/contrib/output/common/output'; +import { IFileOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/contrib/output/browser/outputActions.ts b/src/vs/workbench/contrib/output/browser/outputActions.ts index 869b8da42d6853916d860a6f375d976348593d53..1d16cfea3b137b889c1048b8e53234c8c65ac6a7 100644 --- a/src/vs/workbench/contrib/output/browser/outputActions.ts +++ b/src/vs/workbench/contrib/output/browser/outputActions.ts @@ -6,7 +6,8 @@ import * as nls from 'vs/nls'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { IAction, Action } from 'vs/base/common/actions'; -import { IOutputService, OUTPUT_PANEL_ID, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannelDescriptor, IFileOutputChannelDescriptor } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExt, IOutputChannelDescriptor, IFileOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; +import { IOutputService, OUTPUT_PANEL_ID } from 'vs/workbench/contrib/output/common/output'; import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; diff --git a/src/vs/workbench/contrib/output/browser/outputServices.ts b/src/vs/workbench/contrib/output/browser/outputServices.ts index 940441708e46195f8e4c5bde4c00d07c1d0c67c3..7c21239ae098a1b92dd44b9d36c7d4ad34c6f07a 100644 --- a/src/vs/workbench/contrib/output/browser/outputServices.ts +++ b/src/vs/workbench/contrib/output/browser/outputServices.ts @@ -11,7 +11,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorOptions } from 'vs/workbench/common/editor'; -import { IOutputChannelDescriptor, IOutputChannel, IOutputService, Extensions, OUTPUT_PANEL_ID, IOutputChannelRegistry, OUTPUT_SCHEME, LOG_SCHEME, CONTEXT_ACTIVE_LOG_OUTPUT, LOG_MIME, OUTPUT_MIME } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannel, IOutputService, OUTPUT_PANEL_ID, OUTPUT_SCHEME, LOG_SCHEME, CONTEXT_ACTIVE_LOG_OUTPUT, LOG_MIME, OUTPUT_MIME } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelDescriptor, Extensions, IOutputChannelRegistry } from 'vs/workbench/services/output/common/output'; import { OutputPanel } from 'vs/workbench/contrib/output/browser/outputPanel'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { OutputLinkProvider } from 'vs/workbench/contrib/output/common/outputLinkProvider'; diff --git a/src/vs/workbench/contrib/output/common/output.ts b/src/vs/workbench/contrib/output/common/output.ts index 75abffaa04d5781ca517430ac599a5e7f87af80b..d90dcb9908f42cbf6ada30bd604f665c0b5a1286 100644 --- a/src/vs/workbench/contrib/output/common/output.ts +++ b/src/vs/workbench/contrib/output/common/output.ts @@ -3,11 +3,10 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Event, Emitter } from 'vs/base/common/event'; -import { Registry } from 'vs/platform/registry/common/platform'; +import { Event } from 'vs/base/common/event'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { URI } from 'vs/base/common/uri'; +import { IOutputChannelDescriptor } from 'vs/workbench/services/output/common/output'; /** * Mime type used by the output editor. @@ -44,10 +43,6 @@ export const LOG_MODE_ID = 'log'; */ export const OUTPUT_PANEL_ID = 'workbench.panel.output'; -export const Extensions = { - OutputChannels: 'workbench.contributions.outputChannels' -}; - export const OUTPUT_SERVICE_ID = 'outputService'; export const MAX_OUTPUT_LENGTH = 10000 /* Max. number of output lines to show in output */ * 100 /* Guestimated chars per line */; @@ -129,74 +124,3 @@ export interface IOutputChannel { */ dispose(): void; } - -export interface IOutputChannelDescriptor { - id: string; - label: string; - log: boolean; - file?: URI; -} - -export interface IFileOutputChannelDescriptor extends IOutputChannelDescriptor { - file: URI; -} - -export interface IOutputChannelRegistry { - - readonly onDidRegisterChannel: Event; - readonly onDidRemoveChannel: Event; - - /** - * Make an output channel known to the output world. - */ - registerChannel(descriptor: IOutputChannelDescriptor): void; - - /** - * Returns the list of channels known to the output world. - */ - getChannels(): IOutputChannelDescriptor[]; - - /** - * Returns the channel with the passed id. - */ - getChannel(id: string): IOutputChannelDescriptor | undefined; - - /** - * Remove the output channel with the passed id. - */ - removeChannel(id: string): void; -} - -class OutputChannelRegistry implements IOutputChannelRegistry { - private channels = new Map(); - - private readonly _onDidRegisterChannel = new Emitter(); - readonly onDidRegisterChannel: Event = this._onDidRegisterChannel.event; - - private readonly _onDidRemoveChannel = new Emitter(); - readonly onDidRemoveChannel: Event = this._onDidRemoveChannel.event; - - public registerChannel(descriptor: IOutputChannelDescriptor): void { - if (!this.channels.has(descriptor.id)) { - this.channels.set(descriptor.id, descriptor); - this._onDidRegisterChannel.fire(descriptor.id); - } - } - - public getChannels(): IOutputChannelDescriptor[] { - const result: IOutputChannelDescriptor[] = []; - this.channels.forEach(value => result.push(value)); - return result; - } - - public getChannel(id: string): IOutputChannelDescriptor | undefined { - return this.channels.get(id); - } - - public removeChannel(id: string): void { - this.channels.delete(id); - this._onDidRemoveChannel.fire(id); - } -} - -Registry.add(Extensions.OutputChannels, new OutputChannelRegistry()); \ No newline at end of file diff --git a/src/vs/workbench/contrib/remote/common/remote.contribution.ts b/src/vs/workbench/contrib/remote/common/remote.contribution.ts index 5d12781e767bbe7667df5c5c7b41d849409a9bd3..3135630c1b4286c44f61de94258004e8a90b1dfe 100644 --- a/src/vs/workbench/contrib/remote/common/remote.contribution.ts +++ b/src/vs/workbench/contrib/remote/common/remote.contribution.ts @@ -12,7 +12,7 @@ import { Schemas } from 'vs/base/common/network'; import { IRemoteAgentService, RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService'; import { ILogService } from 'vs/platform/log/common/log'; import { LoggerChannelClient } from 'vs/platform/log/common/logIpc'; -import { IOutputChannelRegistry, Extensions as OutputExt, } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExt, } from 'vs/workbench/services/output/common/output'; import { localize } from 'vs/nls'; import { joinPath } from 'vs/base/common/resources'; import { Disposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts index 12092eb95e78af7933eb54c2588796d2824ab1bf..e55480f7c8b56ae66bc4eadfdb78db819273d6c5 100644 --- a/src/vs/workbench/contrib/tasks/browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/browser/task.contribution.ts @@ -20,7 +20,7 @@ import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { StatusbarAlignment, IStatusbarService, IStatusbarEntryAccessor, IStatusbarEntry } from 'vs/workbench/services/statusbar/common/statusbar'; import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; -import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/contrib/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output'; import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { TaskEvent, TaskEventKind, TaskGroup, TASK_RUNNING_STATE } from 'vs/workbench/contrib/tasks/common/tasks'; diff --git a/src/vs/workbench/services/output/common/output.ts b/src/vs/workbench/services/output/common/output.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a0833dd8f1b9ba4a6d39ef2f133329e45e48ad6 --- /dev/null +++ b/src/vs/workbench/services/output/common/output.ts @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Event, Emitter } from 'vs/base/common/event'; +import { Registry } from 'vs/platform/registry/common/platform'; +import { URI } from 'vs/base/common/uri'; + +export const Extensions = { + OutputChannels: 'workbench.contributions.outputChannels' +}; + +export interface IOutputChannelDescriptor { + id: string; + label: string; + log: boolean; + file?: URI; +} + +export interface IFileOutputChannelDescriptor extends IOutputChannelDescriptor { + file: URI; +} + +export interface IOutputChannelRegistry { + + readonly onDidRegisterChannel: Event; + readonly onDidRemoveChannel: Event; + + /** + * Make an output channel known to the output world. + */ + registerChannel(descriptor: IOutputChannelDescriptor): void; + + /** + * Returns the list of channels known to the output world. + */ + getChannels(): IOutputChannelDescriptor[]; + + /** + * Returns the channel with the passed id. + */ + getChannel(id: string): IOutputChannelDescriptor | undefined; + + /** + * Remove the output channel with the passed id. + */ + removeChannel(id: string): void; +} + +class OutputChannelRegistry implements IOutputChannelRegistry { + private channels = new Map(); + + private readonly _onDidRegisterChannel = new Emitter(); + readonly onDidRegisterChannel: Event = this._onDidRegisterChannel.event; + + private readonly _onDidRemoveChannel = new Emitter(); + readonly onDidRemoveChannel: Event = this._onDidRemoveChannel.event; + + public registerChannel(descriptor: IOutputChannelDescriptor): void { + if (!this.channels.has(descriptor.id)) { + this.channels.set(descriptor.id, descriptor); + this._onDidRegisterChannel.fire(descriptor.id); + } + } + + public getChannels(): IOutputChannelDescriptor[] { + const result: IOutputChannelDescriptor[] = []; + this.channels.forEach(value => result.push(value)); + return result; + } + + public getChannel(id: string): IOutputChannelDescriptor | undefined { + return this.channels.get(id); + } + + public removeChannel(id: string): void { + this.channels.delete(id); + this._onDidRemoveChannel.fire(id); + } +} + +Registry.add(Extensions.OutputChannels, new OutputChannelRegistry());