languageserver brings completion, hover help, navigation, refactoring, diagnostics, and formatting to R editors through the Language Server Protocol.
Documentation · Five-minute walkthrough · Guide sources
Install the CRAN release in the R library your editor uses.
install.packages("languageserver")For the default diagnostics and formatting tools, also install lintr and styler. Linux users building from source may need system libraries. The guides describe the source version they accompany. If you installed an earlier release, compare its features or try a development build from r-universe. Release compatibility · Linux build prerequisites · Development installation
Open an R file in VS Code, Neovim, Emacs, or another LSP client. The setup guide shows how to connect the editor and check the connection by jumping to a local function. Set up your editor
A notebook or browser editor can use run_embedded() in a dedicated R worker and exchange JSON-RPC messages directly. Navigation uses open buffers in the same workspace folder. Hosts can supply their session's package search order. Embed the server · R API
- Complete package functions and members, read hover help, and see argument suggestions. Write and understand R
- Follow a call into another file, find references, and rename a parameter. Navigate and refactor a project
- Edit and format executable R chunks in a mixed-language document. R Markdown and Quarto
- Browse the editor providers, the commands that use them, and worked examples. Feature index · Release history
The server uses incremental tree-sitter parsing for responsive completion, selections, outlines, and folding while you type. The server uses its usual analysis when a syntax tree cannot answer reliably. Read code while you type
The server can use explicit roxygen type annotations for member completion, signature help, navigation, and S3 dispatch. A parameter or return value can name a source class, and @inheritParams can share parameter descriptions across functions. Try roxygen type hints
Signature Help can show method-specific arguments when the server can infer the input class. Try an S3 generic
Select an expression to extract a variable, select statements to extract a function, or inline a local value when its evaluation is preserved. Try an extraction
Use Go to Definition on an S4 generic to open its source declaration and registered methods. Explore S4 declarations
Map a test file to its project helpers so Go to Definition can find them while they are closed. Configure project helpers
Inspect the generated body of an installed function when its original source file is unavailable. Open a package definition
Configure the server through the editor or the R profile that its R process reads. Packages that include these guides provide the settings reference through help("languageserver-settings", package = "languageserver") and the walkthrough through vignette("quick-start", package = "languageserver") in R. Server settings · Server launch options
For missing completions, definitions, or formatting commands, work through the checks for your symptom. Troubleshooting
Configure lintr in the project and inspect diagnostics in the editor. Read a lint finding
Choose lintr or Jarl for diagnostics, and styler or Air for formatting. Choose a backend
Supply a custom diagnostics or formatting function through an R option. Custom adapters
Override the capabilities the server advertises at startup. Capability overrides
Give styler a formatting style function in the server's R profile. Custom styles