提交 e4162e38 编写于 作者: S Sandeep Somavarapu

move output channel registry to workbench services

上级 26c955f0
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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';
......
......@@ -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<string>;
readonly onDidRemoveChannel: Event<string>;
/**
* 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<string, IOutputChannelDescriptor>();
private readonly _onDidRegisterChannel = new Emitter<string>();
readonly onDidRegisterChannel: Event<string> = this._onDidRegisterChannel.event;
private readonly _onDidRemoveChannel = new Emitter<string>();
readonly onDidRemoveChannel: Event<string> = 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
......@@ -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';
......
......@@ -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';
......
/*---------------------------------------------------------------------------------------------
* 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<string>;
readonly onDidRemoveChannel: Event<string>;
/**
* 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<string, IOutputChannelDescriptor>();
private readonly _onDidRegisterChannel = new Emitter<string>();
readonly onDidRegisterChannel: Event<string> = this._onDidRegisterChannel.event;
private readonly _onDidRemoveChannel = new Emitter<string>();
readonly onDidRemoveChannel: Event<string> = 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());
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册