Getting started
ry is a toolchain for R, written in Rust. It is four tools in one binary:
- A language server — hover, completion, go-to-definition, references, rename, and inlay hints, in any editor that supports LSP.
- A formatter — a single consistent style; no configuration beyond indent width and line endings.
- An R console — a REPL with project-aware completion.
- A type checker — optional; its inferred types also power the editor features.
It requires no changes to your code, and the same binary runs in your editor and in CI.
Install
Section titled “Install”Roughly can be used either as a standalone command-line tool or as an extension in supported editors like VS Code:
- CLI: Download a prebuilt binary
- VS Code Extension: Install from marketplace
- Zed Extension: Install manually from here
For detailed instructions or other installation methods (e.g. for RStudio or building from source) see the installation page.
Your first run
Section titled “Your first run”No configuration, no annotations:
ry checkapply_discount <- function(price, rate) { price * ratee}
apply_discount(100, 0.2)unresolved
! I could not resolve `ratee` in this package, its imports, or builtins. Did you mean `rate`? --[discount.R:2:11] 1 | apply_discount <- function(price, rate) { 2 | price * ratee | ^^^^^ 3 | }
1 problem in 1 fileOne transposed letter, found without running anything. R reports the same mistake only when execution reaches that line.
Now turn on the type checker
Section titled “Now turn on the type checker”Fix the typo and make a different mistake — one no linter can catch, because catching it requires knowing what a value is:
[check]typing = trueapply_discount(100, "0.2")type-mismatch
x expected `double`, found `character` --[discount.R:5:21] 4 | 5 | apply_discount(100, "0.2") | ^^^^^Nothing was annotated. ry worked out that rate is a number because you multiply by it, and that
same knowledge is what hover, completion, and the console’s tab completion read. It runs whether or
not you turn the errors on.