Add kotlin-language-server support to lsp install

pull/2/head
Ensar Sarajčić 2021-10-19 17:52:47 +02:00
parent e040958ca0
commit 5e63c19bc8
1 changed files with 17 additions and 3 deletions

View File

@ -156,6 +156,7 @@ declare -A SUPPORTED_SERVERS=(
["haskell"]="hls" ["haskell"]="hls"
["solidity"]="solang" ["solidity"]="solang"
["xml"]="lemminx" ["xml"]="lemminx"
["kotlin"]="kotlin-language-server"
) )
install () { install () {
@ -244,6 +245,16 @@ install () {
unzip -p /tmp/lemminx-download.zip > $HOME/lsp/xml/lemminx/lemminx unzip -p /tmp/lemminx-download.zip > $HOME/lsp/xml/lemminx/lemminx
chmod +x $HOME/lsp/xml/lemminx/lemminx chmod +x $HOME/lsp/xml/lemminx/lemminx
;; ;;
kotlin-language-server)
if [ -z "$VERSION" ]; then
VERSION="1.1.2"
fi
FILE_NAME="server.zip"
wget -O - https://github.com/fwcd/kotlin-language-server/releases/download/$VERSION/$FILE_NAME > /tmp/kotlin-language-server.zip
mkdir -p $HOME/lsp/kotlin
unzip /tmp/kotlin-language-server.zip -d /tmp/kotlin-language-server
mv /tmp/kotlin-language-server/server $HOME/lsp/kotlin/kotlin-language-server
;;
*) *)
echo "Unknown server: $SERVER" echo "Unknown server: $SERVER"
echo "Run 'lsp status --all' for a list of available servers" echo "Run 'lsp status --all' for a list of available servers"
@ -276,6 +287,9 @@ uninstall () {
lemminx) lemminx)
rm -rf $HOME/lsp/xml/lemminx rm -rf $HOME/lsp/xml/lemminx
;; ;;
kotlin-language-server)
rm -rf $HOME/lsp/kotlin/kotlin-language-server
;;
*) *)
echo "Unknown server: $SERVER" echo "Unknown server: $SERVER"
echo "Run 'lsp status' for a list of installed servers" echo "Run 'lsp status' for a list of installed servers"
@ -298,7 +312,7 @@ status () {
echov "Found languages: $LANGUAGES" echov "Found languages: $LANGUAGES"
if [ $ALL -eq 1 ]; then if [ $ALL -eq 1 ]; then
echov "Adding all supported languages" echov "Adding all supported languages"
LANGUAGES+=" java dotnet haskell solidity xml" LANGUAGES+=" ${!SUPPORTED_SERVERS[@]}"
LANGUAGES=$(echo $LANGUAGES | tr ' ' '\n' | sort | uniq -) LANGUAGES=$(echo $LANGUAGES | tr ' ' '\n' | sort | uniq -)
fi fi
echov "Checking languages: $LANGUAGES" echov "Checking languages: $LANGUAGES"
@ -339,7 +353,7 @@ status () {
for server in $SERVERS; do for server in $SERVERS; do
VERSION="UNKNOWN" VERSION="UNKNOWN"
for available_server in "${EXPECTED_SERVERS[@]}"; do for available_server in "${EXPECTED_SERVERS[@]}"; do
if [[ $server = "$available_server" ]]; then if [ "$server" == "$available_server" ]; then
VERSION=$(get_version $server) VERSION=$(get_version $server)
break break
fi fi
@ -352,7 +366,7 @@ status () {
fi fi
INSTALLED=0 INSTALLED=0
for installed_server in "${INSTALLED_SERVERS[@]}"; do for installed_server in "${INSTALLED_SERVERS[@]}"; do
if [[ $server = "$installed_server" ]]; then if [ "$server" == "$installed_server" ]; then
INSTALLED=1 INSTALLED=1
if [ -z "$VERSION" ]; then if [ -z "$VERSION" ]; then
VERSION="UNKNOWN" VERSION="UNKNOWN"