
Arity: a fast R language server, formatter, and linter written in Rust
I'm happy to announce Arity, an all-in-one toolchain for R: a language server, formatter, and linter, built in Rust on top of a lossless, incremental parser (the same rust-analyzer architecture: rowan for syntax trees, salsa for incremental reparsing).
The goal is a fast, deterministic development experience that just works in your editor. Here are some of the the most important features:
- Formatter: deterministic, rule-based formatting toward the tidyverse style guide. Output is idempotent and doesn't depend on your existing line breaks. roxygen comments are handled too.
- Linter: a growing set of correctness, readability, and performance rules, many with safe autofixes.
- Language server: formatting, diagnostics with quick fixes, hover, completion, signature help, go-to-definition and references, rename, document and workspace symbols, semantic tokens, folding, and call hierarchy.
Arity runs on Linux, macOS, and Windows (x86_64 and arm64). You can install it in several ways:
cargo install aritynpm install -g arity-cli(bundles a prebuilt binary, no Rust toolchain needed)uv tool install arityorpipx install arity- VS Code and Open VSX extension (also works in Positron)
- Prebuilt binaries from the releases page
Neovim, Helix, and other editors are covered in the editor setup guide.
Acknowledgements
Arity is heavily inspired by air (Posit's R formatter), and borrows tests, rules, and style from it, as well as from jarl. The big difference from air is that Arity also aims to be a full linter and language server, not just a formatter.
It's still early (v0.8.0), so expect rough edges and please file issues if you encounter them. The docs are at arity.cc and the source is at github.com/jolars/arity.