remove IBroadcastService. Fixes #70831
This commit is contained in:
parent
3fc919eedf
commit
8a374375ea
5 changed files with 0 additions and 115 deletions
|
@ -144,36 +144,6 @@ registerSingleton(IBackupFileService, SimpleBackupFileService, true);
|
|||
|
||||
//#endregion
|
||||
|
||||
//#region Broadcast
|
||||
|
||||
export const IBroadcastService = createDecorator<IBroadcastService>('broadcastService');
|
||||
|
||||
export interface IBroadcast {
|
||||
channel: string;
|
||||
payload: any;
|
||||
}
|
||||
|
||||
export interface IBroadcastService {
|
||||
_serviceBrand: any;
|
||||
|
||||
onBroadcast: Event<IBroadcast>;
|
||||
|
||||
broadcast(b: IBroadcast): void;
|
||||
}
|
||||
|
||||
export class SimpleBroadcastService implements IBroadcastService {
|
||||
|
||||
_serviceBrand: any;
|
||||
|
||||
readonly onBroadcast: Event<IBroadcast> = Event.None;
|
||||
|
||||
broadcast(b: IBroadcast): void { }
|
||||
}
|
||||
|
||||
registerSingleton(IBroadcastService, SimpleBroadcastService, true);
|
||||
|
||||
//#endregion
|
||||
|
||||
//#region Clipboard
|
||||
|
||||
export class SimpleClipboardService implements IClipboardService {
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
|
||||
export const IBroadcastService = createDecorator<IBroadcastService>('broadcastService');
|
||||
|
||||
export interface IBroadcast {
|
||||
channel: string;
|
||||
payload: any;
|
||||
}
|
||||
|
||||
export interface IBroadcastService {
|
||||
_serviceBrand: any;
|
||||
|
||||
onBroadcast: Event<IBroadcast>;
|
||||
|
||||
broadcast(b: IBroadcast): void;
|
||||
}
|
||||
|
||||
export class NullBroadcastService implements IBroadcastService {
|
||||
_serviceBrand: any;
|
||||
onBroadcast: Event<IBroadcast> = Event.None;
|
||||
broadcast(_b: IBroadcast): void {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* 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 { ipcRenderer as ipc } from 'electron';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { IBroadcastService, IBroadcast } from 'vs/workbench/services/broadcast/common/broadcast';
|
||||
|
||||
class BroadcastService extends Disposable implements IBroadcastService {
|
||||
_serviceBrand: any;
|
||||
|
||||
private readonly _onBroadcast: Emitter<IBroadcast> = this._register(new Emitter<IBroadcast>());
|
||||
get onBroadcast(): Event<IBroadcast> { return this._onBroadcast.event; }
|
||||
|
||||
private windowId: number;
|
||||
|
||||
constructor(
|
||||
@IWindowService readonly windowService: IWindowService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
) {
|
||||
super();
|
||||
|
||||
this.windowId = windowService.windowId;
|
||||
|
||||
this.registerListeners();
|
||||
}
|
||||
|
||||
private registerListeners(): void {
|
||||
ipc.on('vscode:broadcast', (event: unknown, b: IBroadcast) => {
|
||||
this.logService.trace(`Received broadcast from main in window ${this.windowId}: `, b);
|
||||
|
||||
this._onBroadcast.fire(b);
|
||||
});
|
||||
}
|
||||
|
||||
broadcast(b: IBroadcast): void {
|
||||
this.logService.trace(`Sending broadcast to main from window ${this.windowId}: `, b);
|
||||
|
||||
ipc.send('vscode:broadcast', this.windowId, {
|
||||
channel: b.channel,
|
||||
payload: b.payload
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
registerSingleton(IBroadcastService, BroadcastService, true);
|
|
@ -104,7 +104,6 @@ import 'vs/workbench/services/decorations/browser/decorationsService';
|
|||
import 'vs/workbench/services/search/node/searchService';
|
||||
import 'vs/workbench/services/progress/browser/progressService';
|
||||
import 'vs/workbench/services/editor/browser/codeEditorService';
|
||||
import 'vs/workbench/services/broadcast/electron-browser/broadcastService';
|
||||
import 'vs/workbench/services/extensions/electron-browser/extensionHostDebugService';
|
||||
import 'vs/workbench/services/preferences/browser/preferencesService';
|
||||
import 'vs/workbench/services/output/node/outputChannelModelService';
|
||||
|
|
|
@ -90,7 +90,6 @@ import { ContextViewService } from 'vs/platform/contextview/browser/contextViewS
|
|||
// import { IURLService } from 'vs/platform/url/common/url';
|
||||
// import { RelayURLService } from 'vs/platform/url/electron-browser/urlService';
|
||||
import { IHeapService, NullHeapService } from 'vs/workbench/services/heap/common/heap';
|
||||
import { IBroadcastService, NullBroadcastService } from 'vs/workbench/services/broadcast/common/broadcast';
|
||||
import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService';
|
||||
import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver';
|
||||
|
||||
|
@ -108,7 +107,6 @@ import 'vs/workbench/services/decorations/browser/decorationsService';
|
|||
// import 'vs/workbench/services/search/node/searchService';
|
||||
import 'vs/workbench/services/progress/browser/progressService';
|
||||
import 'vs/workbench/services/editor/browser/codeEditorService';
|
||||
// import 'vs/workbench/services/broadcast/electron-browser/broadcastService';
|
||||
import 'vs/workbench/services/preferences/browser/preferencesService';
|
||||
import 'vs/workbench/services/output/common/outputChannelModelService';
|
||||
import 'vs/workbench/services/configuration/common/jsonEditingService';
|
||||
|
@ -166,7 +164,6 @@ registerSingleton(IContextViewService, ContextViewService, true);
|
|||
// registerSingleton(IMenubarService, MenubarService);
|
||||
// registerSingleton(IURLService, RelayURLService);
|
||||
registerSingleton(IHeapService, NullHeapService);
|
||||
registerSingleton(IBroadcastService, NullBroadcastService);
|
||||
registerSingleton(IContextMenuService, ContextMenuService);
|
||||
registerSingleton(IConfigurationResolverService, ConfigurationResolverService, true);
|
||||
|
||||
|
|
Loading…
Reference in a new issue