Language Server Protocol

An implementation of the Language Server Protocol for R. The Language Server protocol is used by an editor client to integrate features like auto completion. See <> for details.


languageserver is an implement of the Microsoft's Language Server Protocol for the language of R.

It is released on CRAN and can be easily installed by


The development version of languageserver could be installed by running the following in R


Language Clients

These editors are supported by installing the corresponding package.

let g:LanguageClient_serverCommands = {
    \ 'r': ['R', '--slave', '-e', 'languageserver::run()'],
    \ }
(lsp-define-stdio-client lsp-R "R"
                         (lambda () default-directory)
             '("R" "--slave" "-e" "languageserver::run()"))
(add-hook 'R-mode-hook #'lsp-R-enable)

Services Implemented

languageserver is still under active development, the following services have been implemented:

  • textDocumentSync (diagnostics)
  • hoverProvider
  • completionProvider
  • signatureHelpProvider
  • definitionProvider
  • referencesProvider
  • documentHighlightProvider
  • documentSymbolProvider
  • workspaceSymbolProvider
  • codeActionProvider
  • codeLensProvider
  • documentFormattingProvider
  • documentRangeFormattingProvider
  • documentOnTypeFormattingProvider
  • renameProvider
  • documentLinkProvider
  • executeCommandProvider

Diagnostics settings

User can specify the default linters in .Rprofile. For example,

    packageEvent("languageserver", "onLoad"),
    function(...) {
        options(languageserver.default_linters = lintr::with_defaults(
            line_length_linter = lintr::line_length_linter(100),
            object_usage_linter = NULL,
            object_length_linter = NULL,
            object_name_linter = NULL,
            commented_code_linter = NULL

Please note that this setting is ignored if a .lintr file is found.


languageserver 0.2.4

  • require latest styler release
  • handle windows crlf
  • disable homedir config until lintr is released
  • concat multiple lines in signature
  • Allow package name to contain dots (e.g. data.table)
  • completing variables defined in document
  • support completions and function signatures from documents
  • improve worksync consistency
  • sync all R files of a package
  • load packages in Depends field


  • Randy Lai
  • Lorenz Walthert
  • Kun Ren

languageserver 0.2.3

various improvements

bug fixes:

  • ensure unicode documentation
  • use * as itemBullet for hover help
  • check if rootUri is NULL


  • Randy Lai
  • Kun Ren
  • Ista Zahn

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.2.5 by Randy Lai, 5 months ago

Browse source code at

Authors: Randy Lai

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports callr, collections, desc, jsonlite, lintr, R6, repr, stringr, styler, tools, utils

Suggests processx, testthat

See at CRAN