Skip to content

Add lsp settings to support disabling prompt and additional libPaths#1071

Merged
renkun-ken merged 5 commits into
REditorSupport:masterfrom
renkun-ken:r-lsp-settings
Apr 12, 2022
Merged

Add lsp settings to support disabling prompt and additional libPaths#1071
renkun-ken merged 5 commits into
REditorSupport:masterfrom
renkun-ken:r-lsp-settings

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Apr 10, 2022

Copy link
Copy Markdown
Member

What problem did you solve?

Closes #1037
Closes #1021

This PR adds the following r.lsp settings:

  • r.lsp.promptToInstall to prompt to install languageserver if the package is not installed.
  • r.lsp.libPaths to add additional lib paths for the language server process to start with.

The check before starting languageserver is removed. Instead, a single R process runs a script. It first checks if languageserver is installed and if so it starts the language server with proper arguments. This resolves #1021 so that the startup arguments won't be inconsistent between the R process to check the package and to run the language server.

r.lsp.libPaths could be useful if project package manager like renv is used. In this case, user could add, for example, the following to the vscode settings to the workspace folder if renv is initialized in .vscode and languageserver is installed here.

{
  "r.lsp.libPaths": [
    "${workspaceFolder}/.vscode/renv/library/R-4.1/x86_64-apple-darwin17.0"
  ]
}

The path could be any location that contains a valid installation of languageserver so that the path is appended to .libPaths() before the language server is run.

(If you do not have screenshot) How can I check this pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant