Skip to content

krawitzzZ/zed-hyperlinks-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zed-hyperlinks-server

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.

Capabilities

  • textDocument/documentLink — a clickable link for every rule match.
  • textDocument/semanticTokens/full — a custom hyperlink semantic 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 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.

Releasing a new version

  1. Make your changes to main.js and run the tests (npm test).

  2. Bump the version in package.json and the serverInfo.version returned by the initialize handler in main.js.

  3. Tag and create a release whose tag is v<version> (e.g. v0.0.2) with main.js attached as an asset:

    gh release create v0.0.2 main.js --title v0.0.2 --notes "Add semantic tokens"
  4. Point the extension at the new version by bumping SERVER_VERSION in the extension's src/lib.rs (and the extension's own version), then publishing the updated extension.

Local testing

Run the test suite (unit tests plus stdio integration tests, using Node's built-in runner, no dependencies):

npm test

The server speaks LSP over stdio. You can also drive it manually:

node main.js

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages