vscode icon indicating copy to clipboard operation
vscode copied to clipboard

"Follow link" hover is not linkified on markdown links

Open roblourens opened this issue 1 year ago • 3 comments

Verifying https://github.com/microsoft/vscode/issues/153094, with that sample text

image

Elsewhere, the Follow Link is a link

image

roblourens avatar Aug 24 '22 00:08 roblourens

@jrieken The root cause of this is that markdown lazily resolves link targets. This means that when we try to compute the hover message for the link decoration, we end up thinking there is no link.url so we don't create a markdown link:

https://github.com/microsoft/vscode/blob/b51955e4c878c8facdd775709740c8aa5d1192d6/src/vs/editor/contrib/links/browser/links.ts#L339

I'm going to add a placeholder link target in the markdown extension to fix this. Leaving up to you if we should also fix this in core

mjbvz avatar Aug 30 '22 21:08 mjbvz

Looks like resolve should be called not just on open but also on hover

jrieken avatar Sep 07 '22 16:09 jrieken

I wasn't able to work around this as a language server. If I switch the server to return a fake uri instead of no uri, resolve is no longer called on the documentLink

mjbvz avatar Sep 09 '22 21:09 mjbvz

image

A related case. In this case, the link (@just-web/contributions) is not underscored (i.e. not rendered as a link thus not hover/clickable).

The other 3 are working fine.

I have tested this with all extensions disabled.

unional avatar Oct 03 '22 23:10 unional

@unional That's not related to this issue. Please file an new issue with markdown text that demonstrates the problem

mjbvz avatar Oct 04 '22 18:10 mjbvz

I want to add that for link definitions that start with ^ is not recognized. Maybe I should start a new issue?

PabloLION avatar Nov 14 '23 14:11 PabloLION