diff options
author | mattn <mattn.jp@gmail.com> | 2019-12-26 01:40:37 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-26 01:40:37 +0900 |
commit | f668cd84c7055f7a27836df6f49c652bfc60f8bf (patch) | |
tree | 8bdd2bbdebf81fb9e248ef2b3a775edfeddc902d | |
parent | 572f89e42300f8b503c59a225aecf53a2849c955 (diff) | |
parent | 6fa5eb358c24dc7e0838e790ec0b45141d56a909 (diff) | |
download | vim-lsp-settings-f668cd84c7055f7a27836df6f49c652bfc60f8bf.tar.gz vim-lsp-settings-f668cd84c7055f7a27836df6f49c652bfc60f8bf.tar.bz2 vim-lsp-settings-f668cd84c7055f7a27836df6f49c652bfc60f8bf.zip |
Merge pull request #23 from johejo/feature/support_swift_and_cobol
feature: support swift and cobol
-rw-r--r-- | README.md | 2 | ||||
-rwxr-xr-x | installer/install-cobol-language-support.sh | 22 | ||||
-rw-r--r-- | settings.json | 16 | ||||
-rw-r--r-- | settings/cobol-language-support.vim | 13 | ||||
-rw-r--r-- | settings/sourcekit-lsp.vim | 13 |
5 files changed, 66 insertions, 0 deletions
@@ -77,6 +77,8 @@ Currently, no way to uninstall/update server. Run this command again, newer vers | Scala | Metals | Yes | | Elm | elm-language-server | Yes | | JSON | json-languageserver | Yes | +| Swift | sourcekit-lsp | No | +| COBOL | cobol-language-support | Yes | ## License diff --git a/installer/install-cobol-language-support.sh b/installer/install-cobol-language-support.sh new file mode 100755 index 0000000..f87e1c3 --- /dev/null +++ b/installer/install-cobol-language-support.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) + +server_dir="../servers/cobol-language-support" +[ -d "$server_dir" ] && rm -rf "$server_dir" +mkdir "$server_dir" && cd "$server_dir" + +version="0.9.1" +url="https://github.com/eclipse/che-che4z-lsp-for-cobol/releases/download/$version/cobol-language-support-$version.vsix" +curl -LO "$url" +unzip "cobol-language-support-$version.vsix" + +cat <<EOF >./cobol-language-support +#!/bin/sh +DIR=\$(cd \$(dirname \$0); pwd) +java "-Dline.speparator=\r\n" -jar "\$DIR/extension/server/lsp-service-cobol-$version.jar" pipeEnabled +EOF + +chmod +x ./cobol-language-support diff --git a/settings.json b/settings.json index 8081274..f5604ef 100644 --- a/settings.json +++ b/settings.json @@ -202,5 +202,21 @@ "npm" ] } + ], + "swift": [ + { + "command": "sourcekit-lsp", + "requires": [ + "sourcekit-lsp" + ] + } + ], + "cobol": [ + { + "command": "cobol-language-support", + "requires": [ + "java" + ] + } ] } diff --git a/settings/cobol-language-support.vim b/settings/cobol-language-support.vim new file mode 100644 index 0000000..b0f5dc9 --- /dev/null +++ b/settings/cobol-language-support.vim @@ -0,0 +1,13 @@ +augroup vimlsp_settings_cobol_language_support + au! + LspRegisterServer { + \ 'name': 'cobol-language-support', + \ 'cmd': {server_info->lsp_settings#get('cobol-language-support', 'cmd', [lsp_settings#exec_path('cobol-language-support')])}, + \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), ['.git/']))}, + \ 'initialization_options': lsp_settings#get('cobol-language-support', 'initialization_options', {}), + \ 'whitelist': lsp_settings#get('cobol-language-support', 'whitelist', ['cobol']), + \ 'blacklist': lsp_settings#get('cobol-language-support', 'blacklist', []), + \ 'config': lsp_settings#get('cobol-language-support', 'config', {}), + \ 'workspace_config': lsp_settings#get('cobol-language-support', 'workspace_config', {}), + \ } +augroup END diff --git a/settings/sourcekit-lsp.vim b/settings/sourcekit-lsp.vim new file mode 100644 index 0000000..0d0c155 --- /dev/null +++ b/settings/sourcekit-lsp.vim @@ -0,0 +1,13 @@ +augroup vimlsp_settings_sourcekit_lsp + au! + LspRegisterServer { + \ 'name': 'sourcekit-lsp', + \ 'cmd': {server_info->lsp_settings#get('sourcekit-lsp', 'cmd', [lsp_settings#exec_path('sourcekit-lsp')])}, + \ 'initialization_options': lsp_settings#get('sourcekit-lsp', 'initialization_options', {}), + \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), ['.git/', 'Package.swift', '.xcodeproj', '.xcworkspace', 'Cartfile', 'Podfile']))}, + \ 'whitelist': lsp_settings#get('sourcekit-lsp', 'whitelist', ['swift']), + \ 'blacklist': lsp_settings#get('sourcekit-lsp', 'blacklist', []), + \ 'config': lsp_settings#get('sourcekit-lsp', 'config', {}), + \ 'workspace_config': lsp_settings#get('sourcekit-lsp', 'workspace_config', {}), + \ } +augroup END |