Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts
3290 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
declare module 'vscode' {
7
8
// https://github.com/microsoft/vscode/issues/180582
9
10
export namespace workspace {
11
/**
12
*
13
* @param scheme The URI scheme that this provider can provide canonical URIs for.
14
* A canonical URI represents the conversion of a resource's alias into a source of truth URI.
15
* Multiple aliases may convert to the same source of truth URI.
16
* @param provider A provider which can convert URIs of scheme @param scheme to
17
* a canonical URI which is stable across machines.
18
*/
19
export function registerCanonicalUriProvider(scheme: string, provider: CanonicalUriProvider): Disposable;
20
21
/**
22
*
23
* @param uri The URI to provide a canonical URI for.
24
* @param token A cancellation token for the request.
25
*/
26
export function getCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
27
}
28
29
export interface CanonicalUriProvider {
30
/**
31
*
32
* @param uri The URI to provide a canonical URI for.
33
* @param options Options that the provider should honor in the URI it returns.
34
* @param token A cancellation token for the request.
35
* @returns The canonical URI for the requested URI or undefined if no canonical URI can be provided.
36
*/
37
provideCanonicalUri(uri: Uri, options: CanonicalUriRequestOptions, token: CancellationToken): ProviderResult<Uri>;
38
}
39
40
export interface CanonicalUriRequestOptions {
41
/**
42
*
43
* The desired scheme of the canonical URI.
44
*/
45
targetScheme: string;
46
}
47
}
48
49