-
Notifications
You must be signed in to change notification settings - Fork 38.2k
Closed
Description
Problem
The markdown document link provider creates document links that use command URIs. Currently these have a generic hover message in the editor:
It'd be nicer if a message describing what the link does where shown, something like: Open file. cmd+click to execute
Api
Two ideas on this
Allow DocumentLink to take a Command instead of URI
export class DocumentLink {
/**
* The range this link applies to.
*/
range: Range;
/**
* The uri this link points to or a command executed when the document link is clicked.
*/
target?: Uri | Command;
/**
* Creates a new document link.
*
* @param range The range the document link applies to. Must not be empty.
* @param target The uri the document link points to or a command executed when the document link is clicked.
*/
constructor(range: Range, target?: Uri | Command);
}This would let extensions to set a title or tooltip in the document link.
new vscode.DocumentLink(new vscode.Range(0, 0, 0, 0), {
title: 'Does thing when clicked',
command: 'ext.doThing'
})Add a title property on DocumentLink
export class DocumentLink {
/**
* Label for the document link shown in the UI on hover
*/
tooltip?: string;
/**
* The range this link applies to.
*/
range: Range;
/**
* The uri this link points to.
*/
target?: Uri;
/**
* Creates a new document link.
*
* @param range The range the document link applies to. Must not be empty.
* @param target The uri the document link points to.
*/
constructor(range: Range, target?: Uri);
}Reactions are currently unavailable
