Skip to content

gwbtc/hoon-rs

Repository files navigation

Hoon-rs

Rust based tools for the Hoon language.

Setup

You will need Rust nightly. Check ./rust-toolchain.toml for details.

Nix users are recommended to use Devenv. The included devenv.nix file will automatically build a developer environment for you.

Packages

This is a Rust workspace containing several packages.

Parser

The Hoon parser is a fork of the Nockchain hoon parser.

To build run: cargo build -p hoon-parser.

To test run: ./target/debug/hoon-parser <filename>.hoon

LSP

A Language Server Protocol for Hoon. It depends on hoon-parser.

For details about the implementation status of the different LSP features please read ./LSP_STATUS.md written by OpenAI Codex 5.3.

To build run: cargo build -p hoon-lsp.

To use you'll need to manually added to your IDE config.

VS Code-like editors

Users please edit this

Neovim:

Add the following to your nvim-lspconfig .lua file:

vim.lsp.config('hoon-lsp', {
  cmd = { '/path/to/hoon-rs/target/debug/hoon-lsp', '--stdio' },
  filetypes = { 'bill', 'docket-0', 'hoon', 'kelvin' },
})

vim.lsp.enable 'hoon-lsp'

Helix:

Add the following under the hoon language block in your languages.toml file:

language-servers = ["hoon-lsp"]

Then add the following block somewhere in languages.toml:

[language-server.hoon-lsp]
command = "<absolute path to this repo>/target/debug/hoon-lsp"

Formatter

A code formatter for Hoon. It depends on hoon-parser.

NOTE Formatter is currently broken as it depends on a different fork of hoon-parser which can preserve the different wide/tall/irregular syntax of various runes. Coming soon™.

To build run: cargo build -p hoon-fmt.

To test run: ./target/debug/hoon-fmt <filename>.hoon.

To use you'll need to manually added to your IDE config.

VS Code-like editors

Users please edit this

Neovim:

Users please edit this

Helix:

Add the following under the hoon language block in your languages.toml file:

formatter = {command = "<absolute path to this repo>/target/debug/hoonfmt", args = ["-"]}

About

Hoon language utilities built in Rust: LSP, Formatter, etc.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages