Title: | Automated Setup and Auto Run for R Language Server |
---|---|
Description: | Allows to install the R 'languageserver' with all dependencies into a separate library and use that independent installation automatically when R is instantiated as a language server process. Useful for making language server seamless to use without running into package version conflicts. |
Authors: | Jozef Hajnala [aut, cre] |
Maintainer: | Jozef Hajnala <[email protected]> |
License: | AGPL-3 |
Version: | 0.1.2.900 |
Built: | 2024-06-07 03:01:03 UTC |
Source: | https://github.com/jozefhajnala/languageserversetup |
.Rprofile
Add language server initialization to .Rprofile
languageserver_add_to_rprofile(
rlsLib = getOption("langserver_library"),
rprofilePath = locate_rprofile(),
confirmBeforeChanging = TRUE,
code = append_code(rlsLib = rlsLib)
)
rlsLib |
|
rprofilePath |
Notably, if the |
confirmBeforeChanging |
|
code |
|
side-effects
Detect whether a process relates to the R Language Server
languageserver_detect(pid, os, langServerProcessPatt, checkParents = TRUE)
pid |
|
os |
|
langServerProcessPatt |
|
checkParents |
|
logical(1), TRUE
if the process with pid
(or, optionally,
any of its parents) is detected as the R Language Server process.
Otherwise FALSE
.
languageserver
package to a separate libraryInstall the languageserver
package to a separate library
languageserver_install(
rlsLib = getOption("langserver_library"),
strictLibrary = TRUE,
fullReinstall = TRUE,
fromGitHub = TRUE,
confirmBeforeInstall = TRUE,
dryRun = FALSE,
ref = "master",
Ncpus = max(1L, getOption("Ncpus")),
...
)
rlsLib |
|
strictLibrary |
|
fullReinstall |
|
fromGitHub |
|
confirmBeforeInstall |
|
dryRun |
|
ref |
|
Ncpus |
|
... |
further arguments passed to |
side-effects
.Rprofile
Remove language server initialization from .Rprofile
languageserver_remove_from_rprofile(
rlsLib = getOption("langserver_library"),
rprofilePath = locate_rprofile(),
code = append_code(rlsLib = rlsLib),
confirmBeforeChanging = TRUE
)
rlsLib |
|
rprofilePath |
Notably, if the |
code |
|
confirmBeforeChanging |
|
side-effects
Prepare language server to be started
languageserver_startup(
rlsLib = getOption("langserver_library"),
langServerProcessPatt = getOption("langserver_processPatt"),
strictLibrary = TRUE,
os = tolower(Sys.info()[["sysname"]]),
pid = Sys.getpid()
)
rlsLib |
|
langServerProcessPatt |
|
strictLibrary |
|
os |
|
pid |
|
side-effects