Skip to content

renkun-ken/languageserver

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

languageserver: An implementation of the Language Server Protocol for R

CRAN_Status_Badge

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

install.packages("languageserver")

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

source("https://install-github.me/REditorSupport/languageserver")

Language Clients

These editors are supported by installing the corresponding package.

let g:LanguageClient_serverCommands = {
    \ 'r': ['R', '--quiet', '--slave', '-e', 'languageserver::run()'],
    \ }
(lsp-define-stdio-client lsp-R "R"
                         (lambda () default-directory)
			 '("R" "--quiet" "--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. Please note that this setting is ignored if a .lintr file is found.

options(languageserver.default_linters = lintr::with_defaults(
    line_length_linter = lintr::line_length_linter(100),
    object_length_linter = NULL,
    object_name_linter = NULL,
    commented_code_linter = NULL
))

About

An implementation of the Language Server Protocol for R

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • R 84.4%
  • C 15.6%