mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010 (#7415)
* Merge from vscode f2d41726ba5a0e8abfe61b2c743022b1b6372010 * add missing files
This commit is contained in:
@@ -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) { }
|
||||
|
||||
Reference in New Issue
Block a user