diff options
author | Mitsuo Heijo <mitsuo.heijo@gmail.com> | 2019-12-24 23:38:50 +0900 |
---|---|---|
committer | Mitsuo Heijo <mitsuo.heijo@gmail.com> | 2019-12-24 23:39:14 +0900 |
commit | c61632d625d340db4dcb4cc57c7d1d38fac5ccb8 (patch) | |
tree | 3da978115f86719d344ac34d1d51df94d39a5d5c /installer | |
parent | 6bb33eb9bfeb5f2edf29f6fe517dd94014e67e88 (diff) | |
download | vim-lsp-settings-c61632d625d340db4dcb4cc57c7d1d38fac5ccb8.tar.gz vim-lsp-settings-c61632d625d340db4dcb4cc57c7d1d38fac5ccb8.tar.bz2 vim-lsp-settings-c61632d625d340db4dcb4cc57c7d1d38fac5ccb8.zip |
feature: support metals, fortls
- fix: imporve npm and pip install
- proposal: add simple test script
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/install-bash-language-server.sh | 11 | ||||
-rwxr-xr-x | installer/install-css-languageserver.sh | 8 | ||||
-rwxr-xr-x | installer/install-docker-langserver.sh | 11 | ||||
-rwxr-xr-x | installer/install-fortls.sh | 6 | ||||
-rwxr-xr-x | installer/install-html-languageserver.sh | 8 | ||||
-rwxr-xr-x | installer/install-javascript-typescript-langserver.sh | 18 | ||||
-rwxr-xr-x | installer/install-metals.sh | 16 | ||||
-rwxr-xr-x | installer/install-pyls.sh | 9 | ||||
-rwxr-xr-x | installer/install-typescript-language-server.sh | 16 | ||||
-rwxr-xr-x | installer/install-vim-language-server.sh | 18 | ||||
-rwxr-xr-x | installer/install-yaml-language-server.sh | 13 | ||||
-rw-r--r-- | installer/npm.sh | 23 | ||||
-rw-r--r-- | installer/pip3.sh | 16 |
13 files changed, 93 insertions, 80 deletions
diff --git a/installer/install-bash-language-server.sh b/installer/install-bash-language-server.sh index 44f6efd..c27d0d8 100755 --- a/installer/install-bash-language-server.sh +++ b/installer/install-bash-language-server.sh @@ -2,14 +2,7 @@ set -e -server_dir="../servers/bash-language-server" - cd $(dirname $0) -[ -d $server_dir ] && rm -rf $server_dir -mkdir $server_dir && cd $server_dir - -npm init -y -sed -i -e 's/\"name\":.*$/\"name\": \"\",/' package.json -npm install bash-language-server -ln -s ./node_modules/.bin/bash-language-server . +. ./npm.sh +npm_install bash-language-server bash-language-server diff --git a/installer/install-css-languageserver.sh b/installer/install-css-languageserver.sh new file mode 100755 index 0000000..ae7c8a6 --- /dev/null +++ b/installer/install-css-languageserver.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) + +. ./npm.sh +npm_install css-languageserver vscode-css-languageserver-bin diff --git a/installer/install-docker-langserver.sh b/installer/install-docker-langserver.sh index 59e0b7e..28b433f 100755 --- a/installer/install-docker-langserver.sh +++ b/installer/install-docker-langserver.sh @@ -2,14 +2,7 @@ set -e -server_dir="../servers/docker-langserver" - cd $(dirname $0) -[ -d $server_dir ] && rm -rf $server_dir -mkdir $server_dir && cd $server_dir - -npm init -y -sed -i -e 's/\"name\":.*$/\"name\": \"\",/' package.json -npm install dockerfile-language-server-nodejs -ln -s ./node_modules/.bin/docker-langserver . +. ./npm.sh +npm_install docker-langserver dockerfile-language-server-nodejs diff --git a/installer/install-fortls.sh b/installer/install-fortls.sh new file mode 100755 index 0000000..9685151 --- /dev/null +++ b/installer/install-fortls.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +cd $(dirname $0) + +. ./pip3.sh +pip_install fortls fortran-language-server diff --git a/installer/install-html-languageserver.sh b/installer/install-html-languageserver.sh new file mode 100755 index 0000000..6838379 --- /dev/null +++ b/installer/install-html-languageserver.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) + +. ./npm.sh +npm_install html-languageserver vscode-html-languageserver-bin diff --git a/installer/install-javascript-typescript-langserver.sh b/installer/install-javascript-typescript-langserver.sh index 572a8df..de35663 100755 --- a/installer/install-javascript-typescript-langserver.sh +++ b/installer/install-javascript-typescript-langserver.sh @@ -1,20 +1,8 @@ -#!/bin/sh +#!/bin/bash set -e cd $(dirname $0) -[ -d ../servers/javascript-typescript-langserver ] && rm -rf ../servers/javascript-typescript-langserver -mkdir ../servers/javascript-typescript-langserver -cd ../servers/javascript-typescript-langserver -git clone https://github.com/sourcegraph/javascript-typescript-langserver . -npm install -npm build -cat <<EOF > javascript-typescript-langserver -#!/bin/sh - -DIR=\$(cd \$(dirname \$0); pwd) -node \$DIR/lib/language-server-stdio.js -EOF - -chmod +x javascript-typescript-langserver +. ./npm.sh +npm_install javascript-typescript-langserver javascript-typescript-langserver diff --git a/installer/install-metals.sh b/installer/install-metals.sh new file mode 100755 index 0000000..58c7a23 --- /dev/null +++ b/installer/install-metals.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +cd $(dirname $0) + +server_dir="../servers/metals" + +[ -d $server_dir ] && rm -rf $server_dir +mkdir $server_dir && cd $server_dir + +curl -Lo ./coursier https://git.io/coursier-cli +chmod +x ./coursier + +version="0.7.6" +java -jar ./coursier bootstrap --ttl Inf "org.scalameta:metals_2.12:$version" -r "bintray:scalacenter/releases" -r "sonatype:public" -r "sonatype:snapshots" -o ./metals diff --git a/installer/install-pyls.sh b/installer/install-pyls.sh index 4b280fd..fa61803 100755 --- a/installer/install-pyls.sh +++ b/installer/install-pyls.sh @@ -2,12 +2,7 @@ set -e -server_dir="../servers/pyls" - cd $(dirname $0) -[ -d $server_dir ] && rm -rf $server_dir -mkdir $server_dir && cd $server_dir -python3 -m venv ./venv -./venv/bin/pip3 install python-language-server -ln -s ./venv/bin/pyls . +. ./pip3.sh +pip_install pyls python-language-server diff --git a/installer/install-typescript-language-server.sh b/installer/install-typescript-language-server.sh index 8b0cf7e..7669018 100755 --- a/installer/install-typescript-language-server.sh +++ b/installer/install-typescript-language-server.sh @@ -3,18 +3,6 @@ set -e cd $(dirname $0) -[ -d ../servers/typescript-language-server ] && rm -rf ../servers/typescript-language-server -mkdir ../servers/typescript-language-server -cd ../servers/typescript-language-server -git clone https://github.com/theia-ide/typescript-language-server . -yarn -yarn build -cat <<EOF > typescript-language-server -#!/bin/sh - -DIR=\$(cd \$(dirname \$0); pwd) -node \$DIR/server/lib/cli.js --stdio -EOF - -chmod +x typescript-language-server +. ./npm.sh +npm_install typescript-language-server typescript-language-server diff --git a/installer/install-vim-language-server.sh b/installer/install-vim-language-server.sh index be76522..17b87df 100755 --- a/installer/install-vim-language-server.sh +++ b/installer/install-vim-language-server.sh @@ -1,20 +1,8 @@ -#!/bin/sh +#!/bin/bash set -e cd $(dirname $0) -[ -d ../servers/vim-language-server ] && rm -rf ../servers/vim-language-server -mkdir ../servers/vim-language-server -cd ../servers/vim-language-server -git clone https://github.com/iamcco/vim-language-server . -yarn -yarn build -cat <<EOF > vim-language-server -#!/bin/sh - -DIR=\$(cd \$(dirname \$0); pwd) -node \$DIR/bin/index.js --stdio -EOF - -chmod +x vim-language-server +. ./npm.sh +npm_install vim-language-server vim-language-server diff --git a/installer/install-yaml-language-server.sh b/installer/install-yaml-language-server.sh index 015f953..d3f0e47 100755 --- a/installer/install-yaml-language-server.sh +++ b/installer/install-yaml-language-server.sh @@ -4,14 +4,5 @@ set -e cd $(dirname $0) -server_dir="../servers/yaml-language-server" -[ -d $server_dir ] && rm -rf $server_dir -mkdir $server_dir && cd $server_dir - -npm init -y -cat <<EOF >package.json -{"name": ""} -EOF -npm install yaml-language-server - -ln -s ./node_modules/.bin/yaml-language-server . +. ./npm.sh +npm_install yaml-language-server yaml-language-server diff --git a/installer/npm.sh b/installer/npm.sh new file mode 100644 index 0000000..c1ec529 --- /dev/null +++ b/installer/npm.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e + +# Usage +# $ . npm.sh +# $ npm_install [EXECUTABLE_NAME] [NPM_NAME] +npm_install() { + server_dir="../servers/$1" + [ -d "$server_dir" ] && rm -rf "$server_dir" + mkdir "$server_dir" && cd "$server_dir" + + npm init -y + + # Avoid the problem of not being able to install the same package as name in package.json. + # Create an empty package.json. + cat <<EOF >package.json + {"name": ""} +EOF + + npm install "$2" + ln -s "./node_modules/.bin/$1" . +} diff --git a/installer/pip3.sh b/installer/pip3.sh new file mode 100644 index 0000000..b309e88 --- /dev/null +++ b/installer/pip3.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +# Usage +# $ . pip3.sh +# $ pip_install [EXECUTABLE_NAME] [PYPI_NAME] +pip_install() { + server_dir="../servers/$1" + [ -d "$server_dir" ] && rm -rf "$server_dir" + mkdir "$server_dir" && cd "$server_dir" + + python3 -m venv ./venv + ./venv/bin/pip3 install "$2" + ln -s "./venv/bin/$1" . +} |