The document link provider defines the contract between extensions and feature of showing links in the editor.
Fields
optionalresolveDocumentLink:Null<(link:T, token:CancellationToken) ‑> ProviderResult<T>>
Given a link fill in its {@link DocumentLink.target target}. This method is called when an incomplete link is selected in the UI. Providers can implement this method and return incomplete links (without target) from the {@linkcode DocumentLinkProvider.provideDocumentLinks provideDocumentLinks} method which often helps to improve performance.
Parameters:
link | The link that is to be resolved. |
---|---|
token | A cancellation token. |
provideDocumentLinks(document:TextDocument, token:CancellationToken):ProviderResult<Array<T>>
Provide links for the given document. Note that the editor ships with a default provider that detects
http(s)
and file
links.
@link DocumentLink document links} or a thenable that resolves to such. The lack of a result
can be signaled by returning undefined
, null
, or an empty array.
Parameters:
document | The document in which the command was invoked. |
---|---|
token | A cancellation token. |
Returns:
An array of {