dotfiles/symlinks/bin/lspinstall

74 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
SERVER=$1
VERSION=$2
UNAME=$(sh -c 'uname 2>/dev/null || echo Unknown')
if [[ "$UNAME" == "Windows_NT" ]]; then
UNAME="Windows"
fi
case $SERVER in
jdtls)
if [ -z "$VERSION" ]; then
VERSION="1.4.0"
fi
FILE_NAME=$(curl https://download.eclipse.org/jdtls/milestones/$VERSION/latest.txt)
wget -O - https://download.eclipse.org/jdtls/milestones/$VERSION/$FILE_NAME > /tmp/jdtls.tar.gz
mkdir -p $HOME/lsp/java/jdtls
tar -xf /tmp/jdtls.tar.gz -C $HOME/lsp/java/jdtls
;;
omnisharp)
if [ -z "$VERSION" ]; then
VERSION="v1.37.16"
fi
case $UNAME in
Linux)
FILE_NAME="omnisharp-linux-x64.tar.gz"
;;
Darwin)
FILE_NAME="omnisharp-osx.tar.gz"
;;
esac
wget -O - https://github.com/OmniSharp/omnisharp-roslyn/releases/download/$VERSION/$FILE_NAME > /tmp/omnisharp.tar.gz
mkdir -p $HOME/lsp/dotnet/omnisharp
tar -xf /tmp/omnisharp.tar.gz -C $HOME/lsp/dotnet/omnisharp
;;
hls)
if [ -z "$VERSION" ]; then
VERSION="1.4.0"
fi
case $UNAME in
Linux)
FILE_NAME="haskell-language-server-Linux-${VERSION}.tar.gz"
;;
Darwin)
FILE_NAME="haskell-language-server-macOS-${VERSION}.tar.gz"
;;
esac
wget -O - https://github.com/haskell/haskell-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/hls.tar.gz
mkdir -p $HOME/lsp/haskell/hls
tar -xf /tmp/hls.tar.gz -C $HOME/lsp/haskell/hls
chmod +x $HOME/lsp/haskell/hls/*
;;
solang)
if [ -z "$VERSION" ]; then
VERSION="v0.1.8"
fi
case $UNAME in
Linux)
FILE_NAME="solang-linux"
;;
Windows)
FILE_NAME="solang.exe"
;;
Darwin)
FILE_NAME="solang-mac-intel"
;;
esac
mkdir -p $HOME/lsp/solidity/solang
wget -O - https://github.com/hyperledger-labs/solang/releases/download/$VERSION/$FILE_NAME > $HOME/lsp/solidity/solang/solang
chmod +x $HOME/lsp/solidity/solang/solang
;;
esac