Skip to contents

I get no completions in an R file

  1. Open a saved .R file and check that the editor identifies its language as R. Try the local function in the quick start, using the explicit completion command after typing cen.
  2. Open the client’s language-server log. In VS Code, choose View → Output and select R Language Server. In Neovim 0.11+, run :checkhealth vim.lsp and look for the R client attached to the current buffer. Editor setup
  3. Start the same R executable that the editor launches, from the same project folder. If the editor runs in a container, do this inside the container. Inspect the R installation, its library paths, and where the package is installed.
R.home()
.libPaths()
find.package("languageserver")

If the package lookup fails, run install.packages("languageserver") in this R installation. A project that uses renv may give the editor a different library from a standalone R session. Restart the language server after installing and retry the local completion.

If local names complete but results from an imported package are missing, check for R package metadata progress in an editor that shows indexing progress. A count such as 1 left means the server is still preparing package information. Try the completion again when that work finishes. Track package indexing

Go to Definition misses another file

Open the folder that contains the project and try this pair of files. Save helpers.R with twice <- function(x) x * 2. In a sibling main.R, enter the following, then invoke Go to Definition on twice.

source("helpers.R")
twice(3)

The literal path gives the server a dependency it can follow without running the script. Immediately after opening the file, allow a moment for indexing and try the jump again. A filename chosen at runtime can leave the target unknown. If this example works, check how your original file finds the helper, the selected workspace root, and your index settings. Package projects are recognized by a DESCRIPTION with a Package field and an R/ directory. For helpers loaded by a test runner, configure the mapping between the calling files and their helpers. Project navigation · Configure helper files

Formatting is missing or lint findings never appear

Open a saved .R file and try the score <- 1+2 example with Format Document. If multiple formatters are installed, select the one provided by the R language server. Check the backend selected in your editor settings or .Rprofile. For lintr or styler check packageVersion("lintr") or packageVersion("styler") in the R library used by the server. For Jarl or Air check the executable path with Sys.which(c("jarl", "air")) and its version with jarl --version or air --version in a terminal.

If formatting works on an entire R file but no command appears for a selection, check the backend’s supported modes. If lint findings are missing, check the project’s lint rules, exclusions, and r.lsp.diagnostics. An explicit R option in the server process takes precedence over the matching editor setting. Backend support · Settings

An example is missing from my installation

Run this in the R environment your editor uses.

packageDescription("languageserver")[c("Version", "Repository", "RemoteSha")]

A development build can share a version number with a CRAN release. Use the repository and commit fields, when recorded, to identify which source your editor uses. After installing an update, restart the server so it loads the new package. Compare feature availability

Capture a server log

Set these options in an .Rprofile that the language-server process reads. Restart the server, repeat the action once, then inspect r-languageserver.log in your home directory.

options(
  languageserver.debug = TRUE,
  languageserver.log_file = path.expand("~/r-languageserver.log")
)

When reporting a problem, include the small R example, the cursor location, the editor command, your package and editor versions, and the relevant lines from the log. Remove the debug options and restart when finished. Issue tracker · Server startup