hyperlinks-lsp
v0.0.2
Published
Language server behind the Hyperlinks Zed extension.
Maintainers
Readme
hyperlinks-lsp
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.
Published to npm as hyperlinks-lsp.
Capabilities
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).
Distribution
The server is published to npm. The Hyperlinks Zed extension installs the latest
hyperlinks-lsp package via Zed's npm APIs and runs main.js with Zed's
bundled Node.
Releasing a new version
Make your changes to
main.jsand run the tests (npm test).Bump the version in
package.jsonand theserverInfo.versionreturned by theinitializehandler inmain.js.Publish to npm:
npm publishThe Zed extension picks up the latest published version automatically on next install/update. Bump the extension version only when the extension code itself changes.
Local testing
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