All Projects → REditorSupport → Languageserver

REditorSupport / Languageserver

Licence: other
An implementation of the Language Server Protocol for R

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Languageserver

vim-ccls
Vim plugin for the ccls language server
Stars: ✭ 66 (-80%)
Mutual labels:  language-server-protocol
camel-language-server
The Apache Camel LSP server implementation
Stars: ✭ 31 (-90.61%)
Mutual labels:  language-server-protocol
Elm Language Server
Language server implementation for Elm
Stars: ✭ 298 (-9.7%)
Mutual labels:  language-server-protocol
ide-go
Go language support for Atom-IDE, powered by Sourcegraph's Go Language Server
Stars: ✭ 39 (-88.18%)
Mutual labels:  language-server-protocol
LuaHelper
LuaHelper is a High-performance lua VSCode plugin, Language Server Protocol for lua.
Stars: ✭ 170 (-48.48%)
Mutual labels:  language-server-protocol
ide-yaml
Atom-IDE support for YAML language
Stars: ✭ 16 (-95.15%)
Mutual labels:  language-server-protocol
papyrus-lang
📜Advanced language tools for the Papyrus scripting language.
Stars: ✭ 65 (-80.3%)
Mutual labels:  language-server-protocol
Lsp Mode
Emacs client/library for the Language Server Protocol
Stars: ✭ 3,691 (+1018.48%)
Mutual labels:  language-server-protocol
toy-language-server
Example language server (LSP) implementation for a toy language
Stars: ✭ 54 (-83.64%)
Mutual labels:  language-server-protocol
Lsp4j
A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
Stars: ✭ 293 (-11.21%)
Mutual labels:  language-server-protocol
protocol
Package protocol implements Language Server Protocol specification in Go
Stars: ✭ 41 (-87.58%)
Mutual labels:  language-server-protocol
clj-kondo.lsp
Clj-kondo language server and VSCode extension: https://marketplace.visualstudio.com/items?itemName=borkdude.clj-kondo
Stars: ✭ 17 (-94.85%)
Mutual labels:  language-server-protocol
jdtls-launcher
The simplest way to install and launch JDTLS
Stars: ✭ 29 (-91.21%)
Mutual labels:  language-server-protocol
atom-ide-crystal
Crystal IDE package for Atom using the Scry Language Server
Stars: ✭ 24 (-92.73%)
Mutual labels:  language-server-protocol
Sqls
SQL language server written in Go.
Stars: ✭ 301 (-8.79%)
Mutual labels:  language-server-protocol
stardog-language-servers
Language Servers for Stardog Languages
Stars: ✭ 19 (-94.24%)
Mutual labels:  language-server-protocol
nova-typescript
Typescript support for Nova
Stars: ✭ 53 (-83.94%)
Mutual labels:  language-server-protocol
Rls
Repository for the Rust Language Server (aka RLS)
Stars: ✭ 3,426 (+938.18%)
Mutual labels:  language-server-protocol
Languageclient Neovim
Language Server Protocol (LSP) support for vim and neovim.
Stars: ✭ 3,352 (+915.76%)
Mutual labels:  language-server-protocol
Scry
Scry is a code analysis server for https://crystal-lang.org
Stars: ✭ 294 (-10.91%)
Mutual labels:  language-server-protocol

languageserver: An implementation of the Language Server Protocol for R

Gitter Build Status Github Action codecov CRAN_Status_Badge CRAN Downloads

languageserver is an implementation 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:

# install.packages("devtools")
devtools::install_github("REditorSupport/languageserver")

Language Clients

These editors are supported by installing the corresponding package.

  • VSCode: vscode-r-lsp

  • Atom: atom-ide-r

  • Sublime Text: R-IDE

  • Vim/NeoVim: LanguageClient-neovim with settings

    let g:LanguageClient_serverCommands = {
        \ 'r': ['R', '--slave', '-e', 'languageserver::run()'],
        \ }
    

    or, if you use coc.nvim, you can do one of two things:

    • Install coc-r-lsp with:

      :CocInstall coc-r-lsp
      
    • or install the languageserver package in R

      install.packages("languageserver")
      # or install the developement version
      # devtools::install_github("REditorSupport/languageserver")
      

      Then add the following to your Coc config:

      "languageserver": {
          "R": {
              "command": "/usr/bin/R",
              "args" : [ "--slave", "-e", "languageserver::run()"],
              "filetypes" : ["r"]
          }
      }
      
  • Emacs: lsp-mode

  • JupyterLab: jupyterlab-lsp

Services Implemented

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

Settings

languageserver exposes the following settings via workspace/didChangeConfiguration

{
    "r.lsp.debug": {
      "type": "boolean",
      "default": false,
      "description": "Debug R Language Server"
    },
    "r.lsp.diagnostics": {
      "type": "boolean",
      "default": true,
      "description": "Enable Diagnostics"
    }
}

FAQ

Linters

With lintr v2.0.0, the linters can be specified by creating the .lintr file at the project or home directory. Details can be found at lintr documentation. The option languageserver.default_linters is now deprecated in favor of the .lintr approach.

Customizing server capbabilities

Server capabilities are defined in capabilities.R. Users could override the settings by specifiying languageserver.server_capabilities option in .Rprofile. For example, the following code will turn off definitionProvider,

options(
    languageserver.server_capabilities = list(
        definitionProvider = FALSE
    )
)

Please only use this option to disable providers and do not enable any providers that have not been implemented. Changing any other entries may cause unexpected behaviors on the server.

Customizing formatting style

The language server uses styler to perform code formatting. It uses styler::tidyverse_style(indent_by = options$tabSize) as the default style where options is the formatting options.

The formatting style can be customized by specifying languageserver.formatting_style option which is supposed to be a function that accepts an options argument mentioned above. You could consider to put the code in .Rprofile.

styler::tidyverse_style provides numerous arguments to customize the formatting behavior. For example, to make it only work at indention scope:

options(languageserver.formatting_style = function(options) {
    styler::tidyverse_style(scope = "indention", indent_by = options$tabSize)
})

To disable assignment operator fix (replacing = with <-):

options(languageserver.formatting_style = function(options) {
    style <- styler::tidyverse_style(indent_by = options$tabSize)
    style$token$force_assignment_op <- NULL
    style
})

To further customize the formatting style, please refer to Customizing styler.

Using persistent cache for formatting by styler

With styler v1.3, the formatting of top-level expressions can be cached by R.cache, which significantly improves the formatting performance by skipping the expressions that are known in cache to be already formatted. By default, the cache only works within the current session. To make it work across sessions, user must run the following command to perform a one-time authorization to create a permanent directory in user home in an interactive R session:

R.cache::getCachePath()

The first time the command is run, it will ask user whether to create a permanent cache directory. Type Y and enter, the cache directory will be created, and then all cache operations will be done across sessions so that formatted expressions could be remembered globally.

To check if a permanent directory is used or not, run the following command:

styler::cache_info()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].