The language server behind the Hyperlinks Zed extension.
It is a small, dependency-free Node.js LSP server (stdio) that turns text
matching regex rules into clickable document links via textDocument/documentLink,
mirroring the behaviour of the VS Code extension
dlevs/vscode-pattern-links.
textDocument/documentLink— a clickable link for every rule match.textDocument/semanticTokens/full— a customhyperlinksemantic token for every match, so editors can visually highlight the matched text. The token legend is{ tokenTypes: ["hyperlink"], tokenModifiers: [] }; matches that span multiple lines are split into one token per line, as required by LSP. Styling is up to the client (see the extension README for how Zed maps it).
The server is shipped as a GitHub release asset (main.js). The Hyperlinks
extension downloads the main.js asset for the version it pins and runs it with
Zed's bundled Node, caching it locally.
-
Make your changes to
main.jsand run the tests (npm test). -
Bump the version in
package.jsonand theserverInfo.versionreturned by theinitializehandler inmain.js. -
Tag and create a release whose tag is
v<version>(e.g.v0.0.2) withmain.jsattached as an asset:gh release create v0.0.2 main.js --title v0.0.2 --notes "Add semantic tokens" -
Point the extension at the new version by bumping
SERVER_VERSIONin the extension'ssrc/lib.rs(and the extension's own version), then publishing the updated extension.
Run the test suite (unit tests plus stdio integration tests, using Node's built-in runner, no dependencies):
npm testThe server speaks LSP over stdio. You can also drive it manually:
node main.js