Johannes Rieken 2024-05-31 10:55:56 +02:00 committed by GitHub
parent 54dd0ecc65
commit fab42a71ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 1 deletions

View file

@ -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;
}
}

View file

@ -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 () {