Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010 (#7415)

* Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010

* add missing files
This commit is contained in:
Anthony Dresser
2019-09-27 23:30:36 -07:00
committed by GitHub
parent d0fb6de390
commit bca7c8e6bd
123 changed files with 1704 additions and 1330 deletions

View File

@@ -4,49 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import { IChannel, IServerChannel, IClientRouter, IConnectionHub, Client } from 'vs/base/parts/ipc/common/ipc';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IDisposable } from 'vs/base/common/lifecycle';
import { URI } from 'vs/base/common/uri';
import { Event } from 'vs/base/common/event';
import { IURLService, IURLHandler } from 'vs/platform/url/common/url';
import { IURLHandler } from 'vs/platform/url/common/url';
import { CancellationToken } from 'vs/base/common/cancellation';
import { first } from 'vs/base/common/arrays';
export class URLServiceChannel implements IServerChannel {
constructor(private service: IURLService) { }
listen<T>(_: unknown, event: string): Event<T> {
throw new Error(`Event not found: ${event}`);
}
call(_: unknown, command: string, arg?: any): Promise<any> {
switch (command) {
case 'open': return this.service.open(URI.revive(arg));
}
throw new Error(`Call not found: ${command}`);
}
}
export class URLServiceChannelClient implements IURLService {
_serviceBrand: undefined;
constructor(private channel: IChannel) { }
open(url: URI): Promise<boolean> {
return this.channel.call('open', url.toJSON());
}
registerHandler(handler: IURLHandler): IDisposable {
throw new Error('Not implemented.');
}
create(_options?: Partial<UriComponents>): URI {
throw new Error('Method not implemented.');
}
}
export class URLHandlerChannel implements IServerChannel {
constructor(private handler: IURLHandler) { }