mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-04 09:35:38 -05:00
* Merge from vscode 1eb87b0e9ce9886afeaecec22b31abd0d9b7939f * fix various icon issues * fix preview features
22 lines
1023 B
TypeScript
22 lines
1023 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { URI, UriComponents } from 'vs/base/common/uri';
|
|
import product from 'vs/platform/product/common/product';
|
|
import { AbstractURLService } from 'vs/platform/url/common/urlService';
|
|
|
|
export class URLService extends AbstractURLService {
|
|
|
|
create(options?: Partial<UriComponents>): URI {
|
|
let { authority, path, query, fragment } = options ? options : { authority: undefined, path: undefined, query: undefined, fragment: undefined };
|
|
|
|
if (authority && path && path.indexOf('/') !== 0) {
|
|
path = `/${path}`; // URI validation requires a path if there is an authority
|
|
}
|
|
|
|
return URI.from({ scheme: product.urlProtocol, authority, path, query, fragment });
|
|
}
|
|
}
|