diff options
author | mattn <mattn.jp@gmail.com> | 2020-01-03 00:04:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 00:04:43 +0900 |
commit | d5893afa770f15c30b38e9480a9d0235977f3b25 (patch) | |
tree | 9120302e45b897901ad49d076c7fa32435885212 | |
parent | f683b9b835f55b184eda28666da198ce0342d33c (diff) | |
parent | c8d7356cd809fffee36d9e3542d85b5b08b9bbae (diff) | |
download | vim-lsp-settings-d5893afa770f15c30b38e9480a9d0235977f3b25.tar.gz vim-lsp-settings-d5893afa770f15c30b38e9480a9d0235977f3b25.tar.bz2 vim-lsp-settings-d5893afa770f15c30b38e9480a9d0235977f3b25.zip |
Merge pull request #58 from mattn/dart
Add dart language server
-rw-r--r-- | installer/install-analysis-server-dart-snapshot.cmd | 11 | ||||
-rw-r--r-- | installer/install-analysis-server-dart-snapshot.sh | 16 | ||||
-rw-r--r-- | settings.json | 22 | ||||
-rw-r--r-- | settings/analysis-server-dart-snapshot.vim | 13 |
4 files changed, 54 insertions, 8 deletions
diff --git a/installer/install-analysis-server-dart-snapshot.cmd b/installer/install-analysis-server-dart-snapshot.cmd new file mode 100644 index 0000000..a24c936 --- /dev/null +++ b/installer/install-analysis-server-dart-snapshot.cmd @@ -0,0 +1,11 @@ +@echo off + +curl -o "dartsdk-windows-x64-release.zip" "https://storage.googleapis.com/dart-archive/channels/dev/release/latest/sdk/dartsdk-windows-x64-release.zip" +call run_unzip.cmd "dartsdk-windows-x64-release.zip" +del "dartsdk-windows-x64-release.zip" + +echo @echo off ^ + +%%~dp0\bin\dart %%~dp0\snapshots\analysis_server.dart.snapshot --lsp %%* ^ + +> analysis-server-dart-snapshot.cmd diff --git a/installer/install-analysis-server-dart-snapshot.sh b/installer/install-analysis-server-dart-snapshot.sh new file mode 100644 index 0000000..c38c29d --- /dev/null +++ b/installer/install-analysis-server-dart-snapshot.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +curl -o "dartsdk-linux-x64-release.zip" "https://storage.googleapis.com/dart-archive/channels/dev/release/latest/sdk/dartsdk-linux-x64-release.zip" +unzip "dartsdk-linux-x64-release.zip" +rm "dartsdk-linux-x64-release.zip" + +cat <<EOF > analysis-server-dart-snapshot +#!/bin/sh + +DIR=\$(cd \$(dirname \$0); pwd) +\$DIR/bin/dart \$DIR/bin/snapshots/analysis_server.dart.snapshot --lsp \$* +EOF + +chmod +x analysis-server-dart-snapshot diff --git a/settings.json b/settings.json index 2100f9d..4e7c716 100644 --- a/settings.json +++ b/settings.json @@ -49,6 +49,12 @@ ] } ], + "dart": [ + { + "command": "analysis-server-dart-snapshot", + "requires": [] + } + ], "dockerfile": [ { "command": "docker-langserver", @@ -95,6 +101,14 @@ ] } ], + "groovy": [ + { + "command": "groovy-language-server", + "requires": [ + "java" + ] + } + ], "html": [ { "command": "html-languageserver", @@ -313,14 +327,6 @@ ] } ], - "groovy": [ - { - "command": "groovy-language-server", - "requires": [ - "java" - ] - } - ], "yaml": [ { "command": "yaml-language-server", diff --git a/settings/analysis-server-dart-snapshot.vim b/settings/analysis-server-dart-snapshot.vim new file mode 100644 index 0000000..e5d056b --- /dev/null +++ b/settings/analysis-server-dart-snapshot.vim @@ -0,0 +1,13 @@ +augroup vimlsp_settings_analysis_server_dart_snapshot + au! + LspRegisterServer { + \ 'name': 'analysis-server-dart-snapshot', + \ 'cmd': {server_info->lsp_settings#get('analysis-server-dart-snapshot', 'cmd', [lsp_settings#exec_path('analysis-server-dart-snapshot')])}, + \ 'root_uri':{server_info->lsp_settings#get('analysis-server-dart-snapshot', 'root_uri', lsp_settings#root_uri(['.git/']))}, + \ 'initialization_options': lsp_settings#get('analysis-server-dart-snapshot', 'initialization_options', v:null), + \ 'whitelist': lsp_settings#get('analysis-server-dart-snapshot', 'whitelist', ['dart']), + \ 'blacklist': lsp_settings#get('analysis-server-dart-snapshot', 'blacklist', []), + \ 'config': lsp_settings#get('analysis-server-dart-snapshot', 'config', {}), + \ 'workspace_config': lsp_settings#get('analysis-server-dart-snapshot', 'workspace_config', {}), + \ } +augroup END |