Allow extensions to control how links are opened #61967
bglgwyng
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What are you proposing?
Add an extension API for controlling how matching URIs are opened.
For example, an extension could register that certain
file://links should open with the system default application rather than inside Zed.Matching could use:
The extension-provided behavior could remain user-overridable.
Why does this matter?
Haskell Language Server can include local Haddock documentation links in hover Markdown:
Zed opens these as HTML source in an editor pane. The intended result is rendered documentation in a browser.
The Haskell extension has enough context to recognize these links, but currently cannot change their handling.
A normal Markdown link also cannot specify LSP’s
external: true; that option only exists on a separatewindow/showDocumentrequest.Examples or context
Current flow:
Related requests:
This proposal does not add a WebView. It provides a smaller workaround for some of the same use cases by delegating resources to external applications.
Possible approach
Allow extensions to register declarative URI rules:
Possible actions:
A narrower first version supporting matched
file://URIs andopen_externallywould be enough for this use case.All reactions