Merge from vscode 4d91d96e5e121b38d33508cdef17868bab255eae

This commit is contained in:
ADS Merger
2020-06-18 04:32:54 +00:00
committed by AzureDataStudio
parent a971aee5bd
commit 5e7071e466
1002 changed files with 24201 additions and 13193 deletions

View File

@@ -26,7 +26,7 @@ export interface IURLHandler {
export interface IURLService {
_serviceBrand: undefined;
readonly _serviceBrand: undefined;
/**
* Create a URL that can be called to trigger IURLhandlers.

View File

@@ -5,21 +5,20 @@
import { IURLService, IURLHandler, IOpenURLOptions } from 'vs/platform/url/common/url';
import { URI, UriComponents } from 'vs/base/common/uri';
import { values } from 'vs/base/common/map';
import { first } from 'vs/base/common/async';
import { toDisposable, IDisposable, Disposable } from 'vs/base/common/lifecycle';
import product from 'vs/platform/product/common/product';
export abstract class AbstractURLService extends Disposable implements IURLService {
_serviceBrand: undefined;
declare readonly _serviceBrand: undefined;
private handlers = new Set<IURLHandler>();
abstract create(options?: Partial<UriComponents>): URI;
open(uri: URI, options?: IOpenURLOptions): Promise<boolean> {
const handlers = values(this.handlers);
const handlers = [...this.handlers.values()];
return first(handlers.map(h => () => h.handleURL(uri, options)), undefined, false).then(val => val || false);
}