Skip to content

show "Follow link" in hover popup for unknown links - #2913

Merged
rchl merged 2 commits into
mainfrom
fix/link-text
May 18, 2026
Merged

rchl merged 2 commits into
mainfrom
fix/link-text

Conversation

@rchl

@rchl rchl commented May 17, 2026 •

Copy link
Copy Markdown
Member

The text shown when hovering document links was not ideal for unknown schemas. In JSON we've shown "Open in browser" for links with json-schema schema.

Screenshot 2026-05-17 at 22 33 20

Show "Open in browser" only for URIs with http/https schema. For other show "Follow link".

If we don't have target then we don't know schema until resolve and we'll also show "Follow link".

@jwortmann

Copy link
Copy Markdown
Member

IIRC the code at

LSP/plugin/hover.py

Lines 344 to 345 in 608929e

elif scheme:
sublime.set_timeout_async(partial(self.try_open_custom_uri_async, uri))

was added later, and at the time when this label was implemented it would always fall back to open unknown links in the browser, that is why the original label was like that.

The fix looks good, but should we maybe adjust the label to Open Link instead of Follow Link?

@rchl

rchl commented May 18, 2026

Copy link
Copy Markdown
Member Author

The fix looks good, but should we maybe adjust the label to Open Link instead of Follow Link?

In that example that I gave, Follow link makes more sense IMO since it's a link to a different position in the same file. But Open link would work too I guess.

@rchl
rchl merged commit 271724d into main May 18, 2026
8 checks passed
@rchl
rchl deleted the fix/link-text branch May 18, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants