aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--installer/install-r-languageserver.cmd10
-rwxr-xr-xinstaller/install-r-languageserver.sh13
-rw-r--r--settings.json8
-rw-r--r--settings/r-languageserver.vim14
5 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md
index 2bd148e..4f56095 100644
--- a/README.md
+++ b/README.md
@@ -90,6 +90,7 @@ Currently, no way to uninstall/update server. Run this command again, newer vers
| SQL | sql-language-server | Yes |
| Lisp | cl-lsp | No |
| Kotlin | kotlin-language-server | Yes |
+| R | languageserver | No |
| * | efm-langserver | Yes |
## Notes
diff --git a/installer/install-r-languageserver.cmd b/installer/install-r-languageserver.cmd
new file mode 100644
index 0000000..699e200
--- /dev/null
+++ b/installer/install-r-languageserver.cmd
@@ -0,0 +1,10 @@
+@echo off
+
+R --slave -e install.packages("languageserver")
+
+echo @echo off ^
+
+R --slave -e "languageserver::run()" ^
+
+> r-languageserver.cmd
+
diff --git a/installer/install-r-languageserver.sh b/installer/install-r-languageserver.sh
new file mode 100755
index 0000000..eeaa676
--- /dev/null
+++ b/installer/install-r-languageserver.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+set -e
+
+R --slave -e 'install.packages("languageserver")'
+
+cat <<EOF >r-languageserver
+#!/usr/bin/env bash
+
+R --slave -e 'languageserver::run()'
+EOF
+
+chmod +x r-languageserver
diff --git a/settings.json b/settings.json
index c7163ce..b99e94a 100644
--- a/settings.json
+++ b/settings.json
@@ -344,6 +344,14 @@
]
}
],
+ "r": [
+ {
+ "command": "r-languageserver",
+ "requires": [
+ "R"
+ ]
+ }
+ ],
"reason": [
{
"command": "reason-language-server",
diff --git a/settings/r-languageserver.vim b/settings/r-languageserver.vim
new file mode 100644
index 0000000..aace440
--- /dev/null
+++ b/settings/r-languageserver.vim
@@ -0,0 +1,14 @@
+augroup vimlsp_settings_r_languageserver
+ au!
+ LspRegisterServer {
+ \ 'name': 'r-languageserver',
+ \ 'cmd': {server_info->lsp_settings#get('r-languageserver', 'cmd', ['R', '--slave', '-e', 'languageserver::run()'])},
+ \ 'root_uri':{server_info->lsp_settings#get('r-languageserver', 'root_uri', lsp_settings#root_uri(g:lsp_settings_root_markers))},
+ \ 'initialization_options': lsp_settings#get('r-languageserver', 'initialization_options', v:null),
+ \ 'whitelist': lsp_settings#get('r-languageserver', 'whitelist', ['r']),
+ \ 'blacklist': lsp_settings#get('r-languageserver', 'blacklist', []),
+ \ 'config': lsp_settings#get('r-languageserver', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('r-languageserver', 'workspace_config', {}),
+ \ }
+augroup END
+