Setup and initialize R language server seamlessly and automatically with editors such as VS Code across platforms.
.Rprofile
to make startup of the language
server seamless when appropriateYou can install languageserversetup
from CRAN. It has no
dependencies, so no other packages are installed:
install.packages("languageserversetup")
You can also install the latest development version from the master branch on GitHub using the remotes package:
::install_github("jozefhajnala/languageserversetup") remotes
languageserver
package and all it’s
dependencies into a separate independent library (Will ask for
confirmation before taking action)::languageserver_install() languageserversetup
.Rprofile
to automatically instantiate
languageserver if the process is an instance of the languageserver,
otherwise, the R session will run as usual with library paths
unaffected::languageserver_add_to_rprofile() languageserversetup
languageserver_install()
languageserver_add_to_rprofile()
All done, enjoy the awesomeness!
Currently, the functionality is tested on 64bit versions of MS Windows 7, 10, Ubuntu 18.10 and MacOS El Capitan. Automated deployments and tests run via GitHub actions on macos-elcapitan-release, windows-x86_64-devel, ubuntu-gcc-release and fedora-clang-devel.
All PR and issues related to platform support are most welcome!
To remove the functionality, run (Will ask for confirmation before taking action):
::languageserver_remove_from_rprofile() languageserversetup
If the above does not succeed, remove the
languageserersetup
related code from your
.Rprofile
. Optionally, you can also delete the library
where languageserver was installed itself.
path.expand(file.path("~", "languageserver-library"))
.options(langserver_library = "/desired/path/to/library")
before running languageserver_install()
..Rprofile
code chunk created by
languageserver_add_to_rprofile()
to your liking manually.
Since the installation is stand-alone, if you want, you can also
manually move the entire library to a new location by simply copying the
library directory..Rprofile
By default, an .Rprofile
file located in the user’s home
directory is used. If it does not exist, it is created. If it does
exist, code is appended to the end of the file (after user
confirmation).
The languageserver_install()
function has a
fromGitHub
argument. Set it to FALSE
to
install the CRAN version of the languageserver package. Otherwise, the
latest development version is installed from the master branch of the
languageserver GitHub repository.
The default package behavior can be adjusted by the following
options, ideally placed in the .Rprofile
file before the
call to library(languageserversetup)
options(langserver_quiet = FALSE)
to enable diagnostic
messagesoptions(langserver_quiet_serverproc = TRUE)
to
disable diagnostic messages for the language server identified
processoptions(langserver_library = "desired/path/to/library")
Please refer to the help files:
?languageserver_install
?languageserver_startup
?languageserver_add_to_rprofile ?languageserver_remove_from_rprofile
AGPL-3