aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-01-29 00:31:32 +0900
committerGitHub <noreply@github.com>2020-01-29 00:31:32 +0900
commitba7d4fd8a0af3b16eda2db3d1ca54f09e163ed4a (patch)
tree112541420be3559fed36a95e3d5b50ad1aedad45
parent3562d7b853a6fb2589631b42517348f5af8ab760 (diff)
parentc471a25d1140d42f74a07a9ae008d82f5e6341ac (diff)
downloadvim-lsp-settings-ba7d4fd8a0af3b16eda2db3d1ca54f09e163ed4a.tar.gz
vim-lsp-settings-ba7d4fd8a0af3b16eda2db3d1ca54f09e163ed4a.tar.bz2
vim-lsp-settings-ba7d4fd8a0af3b16eda2db3d1ca54f09e163ed4a.zip
Merge pull request #107 from mattn/rust-analyzer
Add rust-analyzer
-rw-r--r--installer/install-ra_lsp_server.cmd5
-rwxr-xr-xinstaller/install-ra_lsp_server.sh18
-rw-r--r--settings.json4
-rw-r--r--settings/ra_lsp_server.vim13
4 files changed, 40 insertions, 0 deletions
diff --git a/installer/install-ra_lsp_server.cmd b/installer/install-ra_lsp_server.cmd
new file mode 100644
index 0000000..19e063c
--- /dev/null
+++ b/installer/install-ra_lsp_server.cmd
@@ -0,0 +1,5 @@
+@echo off
+
+curl -L -o ra_lsp_server-windows.exe "https://github.com/rust-analyzer/rust-analyzer/releases/download/2020-01-27/ra_lsp_server-windows.exe"
+
+move ra_lsp_server-windows.exe ra_lsp_server.exe
diff --git a/installer/install-ra_lsp_server.sh b/installer/install-ra_lsp_server.sh
new file mode 100755
index 0000000..9e37113
--- /dev/null
+++ b/installer/install-ra_lsp_server.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+os=$(uname -s | tr "[:upper:]" "[:lower:]")
+
+case $os in
+ linux)
+ platform="linux"
+ ;;
+ darwin)
+ platform="mac"
+ ;;
+esac
+
+curl -L -o ra_lsp_server-$platform "https://github.com/rust-analyzer/rust-analyzer/releases/download/2020-01-27/ra_lsp_server-$platform"
+
+mv ra_lsp_server-$platform ra_lsp_server
diff --git a/settings.json b/settings.json
index c83cdb1..3878bee 100644
--- a/settings.json
+++ b/settings.json
@@ -357,6 +357,10 @@
{
"command": "rls",
"requires": []
+ },
+ {
+ "command": "ra_lsp_server",
+ "requires": []
}
],
"sass": [
diff --git a/settings/ra_lsp_server.vim b/settings/ra_lsp_server.vim
new file mode 100644
index 0000000..5965e7e
--- /dev/null
+++ b/settings/ra_lsp_server.vim
@@ -0,0 +1,13 @@
+augroup vimlsp_settings_ra_lsp_server
+ au!
+ LspRegisterServer {
+ \ 'name': 'ra_lsp_server',
+ \ 'cmd': {server_info->lsp_settings#get('ra_lsp_server', 'cmd', [lsp_settings#exec_path('ra_lsp_server')])},
+ \ 'root_uri':{server_info->lsp_settings#get('ra_lsp_server', 'root_uri', lsp_settings#root_uri(g:lsp_settings_root_markers))},
+ \ 'initialization_options': lsp_settings#get('ra_lsp_server', 'initialization_options', v:null),
+ \ 'whitelist': lsp_settings#get('ra_lsp_server', 'whitelist', ['rust']),
+ \ 'blacklist': lsp_settings#get('ra_lsp_server', 'blacklist', []),
+ \ 'config': lsp_settings#get('ra_lsp_server', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('ra_lsp_server', 'workspace_config', {}),
+ \ }
+augroup END