mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
This commit is contained in:
parent
54dd0ecc65
commit
fab42a71ba
|
@ -1330,7 +1330,9 @@ export namespace DocumentLink {
|
|||
// ignore
|
||||
}
|
||||
}
|
||||
return new types.DocumentLink(Range.to(link.range), target);
|
||||
const result = new types.DocumentLink(Range.to(link.range), target);
|
||||
result.tooltip = link.tooltip;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1275,6 +1275,22 @@ suite('ExtHostLanguageFeatureCommands', function () {
|
|||
|
||||
});
|
||||
|
||||
testApiCmd('DocumentLink[] vscode.executeLinkProvider returns lack tooltip #213970', async function () {
|
||||
disposables.push(extHost.registerDocumentLinkProvider(nullExtensionDescription, defaultSelector, <vscode.DocumentLinkProvider>{
|
||||
provideDocumentLinks(): any {
|
||||
const link = new types.DocumentLink(new types.Range(0, 0, 0, 20), URI.parse('foo:bar'));
|
||||
link.tooltip = 'Link Tooltip';
|
||||
return [link];
|
||||
}
|
||||
}));
|
||||
|
||||
await rpcProtocol.sync();
|
||||
|
||||
const links1 = await commands.executeCommand<vscode.DocumentLink[]>('vscode.executeLinkProvider', model.uri);
|
||||
assert.strictEqual(links1.length, 1);
|
||||
assert.strictEqual(links1[0].tooltip, 'Link Tooltip');
|
||||
});
|
||||
|
||||
|
||||
test('Color provider', function () {
|
||||
|
||||
|
|
Loading…
Reference in a new issue