A language server, formatter, and linter for R.
Quick start
- Install the Arity extension.
- Open an R file (
.R,.r,.Rprofile). - The extension starts
arity lspautomatically.
By default, the extension uses an arity binary that ships inside the extension
(one platform-specific VSIX per OS/architecture), falling back to downloading a
matching binary from GitHub releases when none is bundled.
Features
- Starts
arity lspautomatically when you open R files. - Formats R code using Arity's deterministic, tidyverse-style formatter.
- Surfaces Arity diagnostics and quick-fix code actions in the editor.
- Registers itself as the default formatter for
[r]files.
Commands
Arity: Restart Server: stops and restarts the Arity language server (re-reads settings and re-resolves the binary). Useful if the LSP gets wedged or after changing settings such asarity.versionorarity.executablePath.
Using only some features
The formatter, linter, and language features share one server but can be turned off independently, so you can adopt just the parts you want:
arity.formatting.enable: use Arity as a formatter.arity.diagnostics.enable: show Arity diagnostics (the linter).arity.languageFeatures.enable: hover, completion, navigation, symbols, rename (includingsource()path updates when you move a file or folder), code actions, semantic tokens, and the rest.
All three default to true. They are client-side gates, so the server keeps
running and the toggles take effect without a restart or reinstall. For a
formatter-only setup, turn off the other two:
{
"arity.diagnostics.enable": false,
"arity.languageFeatures.enable": false
}
Turning off arity.diagnostics.enable this way suppresses every diagnostic,
including the syntax/parse errors that an arity.toml [lint] selection cannot
silence. The arity.toml route stays the right tool when you want to keep parse
errors but mute specific lint rules across every editor and the CLI.
Binary installation
By default, the extension uses an arity binary that ships inside the extension
itself (one platform-specific VSIX per OS/architecture). No download, no GitHub
round-trip, and the language server starts on first activation even on
restricted or offline networks. Behavior is controlled by
arity.executableStrategy:
bundled(default): use the binary that ships inside the extension. If you're on a platform without a platform-specific build (or you've installed the universal VSIX), the extension falls back to downloading a matching binary from GitHub releases.environment: look forarityon the systemPATH.path: use the binary atarity.executablePath.
If you set arity.version or arity.releaseTag explicitly, the bundled binary
is skipped and the requested version is downloaded from GitHub. When
arity.version is latest, the extension selects the most recent stable
release that contains a matching platform asset.
Common setup examples
Use a local binary at a fixed path:
{
"arity.executableStrategy": "path",
"arity.executablePath": "/usr/local/bin/arity"
}
Use whatever arity is on your PATH:
{
"arity.executableStrategy": "environment"
}
Pin to a specific release:
{
"arity.version": "0.2.0",
"arity.githubRepo": "jolars/arity"
}
Use arity.releaseTag only if you need an exact tag override:
{
"arity.releaseTag": "v0.2.0"
}
Requirements and troubleshooting
- NixOS: the bundled binary won't run because of the dynamic loader path.
The extension detects NixOS and skips the download, using
arityon yourPATHinstead; installarity(for example via thearitypackage) or setarity.executableStrategytopathwitharity.executablePath. - Offline/restricted networks/proxies: the bundled-binary default works
without network access. Only the explicit-version download paths
(
arity.version/arity.releaseTag) require GitHub connectivity. - If a download fall-through fails, the extension shows a warning and falls back
to looking up
arityon the systemPATH.
Settings
Arity registers itself as the default formatter for [r] files.
arity.formatting.enable: contribute formatting edits (default:true).arity.diagnostics.enable: show diagnostics from the linter (default:true).arity.languageFeatures.enable: hover, completion, navigation, symbols, rename (includingsource()path updates when you move a file or folder), code actions, and the rest (default:true).arity.executableStrategy: how to locate thearitybinary:bundled(default),environment, orpath.arity.executablePath: path to the binary, used only whenexecutableStrategyispath.arity.version: version to install (default:"latest").arity.releaseTag: advanced exact tag override (takes precedence if explicitly set).arity.githubRepo: GitHub repo for downloads (default:"jolars/arity").arity.serverArgs: extra args afterarity lsp.arity.serverEnv: extra environment variables.arity.extraPath: extra PATH entries prepended for the language server process.arity.logLevel: log level for the language server, mapped toRUST_LOG(off,error,warn,info,debug,trace; unset by default).arity.serverEnv.RUST_LOGoverrides this if both are set.arity.trace.server: LSP trace level (off,messages,verbose).
Security and trust
When arity.executableStrategy is bundled (the default), the extension
prefers the binary that shipped inside the VSIX. If no bundled binary is
available, or arity.version/arity.releaseTag is set explicitly, it downloads
from GitHub releases configured by arity.githubRepo (default jolars/arity).