From 5e63c19bc8ece331315ea1750fbb9ff17d87f9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ensar=20Saraj=C4=8Di=C4=87?= Date: Tue, 19 Oct 2021 17:52:47 +0200 Subject: [PATCH] Add kotlin-language-server support to lsp install --- symlinks/bin/lsp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/symlinks/bin/lsp b/symlinks/bin/lsp index ce48d78..9e4a82c 100755 --- a/symlinks/bin/lsp +++ b/symlinks/bin/lsp @@ -156,6 +156,7 @@ declare -A SUPPORTED_SERVERS=( ["haskell"]="hls" ["solidity"]="solang" ["xml"]="lemminx" + ["kotlin"]="kotlin-language-server" ) install () { @@ -244,6 +245,16 @@ install () { unzip -p /tmp/lemminx-download.zip > $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 "Run 'lsp status --all' for a list of available servers" @@ -276,6 +287,9 @@ uninstall () { lemminx) rm -rf $HOME/lsp/xml/lemminx ;; + kotlin-language-server) + rm -rf $HOME/lsp/kotlin/kotlin-language-server + ;; *) echo "Unknown server: $SERVER" echo "Run 'lsp status' for a list of installed servers" @@ -298,7 +312,7 @@ status () { echov "Found languages: $LANGUAGES" if [ $ALL -eq 1 ]; then echov "Adding all supported languages" - LANGUAGES+=" java dotnet haskell solidity xml" + LANGUAGES+=" ${!SUPPORTED_SERVERS[@]}" LANGUAGES=$(echo $LANGUAGES | tr ' ' '\n' | sort | uniq -) fi echov "Checking languages: $LANGUAGES" @@ -339,7 +353,7 @@ status () { for server in $SERVERS; do VERSION="UNKNOWN" for available_server in "${EXPECTED_SERVERS[@]}"; do - if [[ $server = "$available_server" ]]; then + if [ "$server" == "$available_server" ]; then VERSION=$(get_version $server) break fi @@ -352,7 +366,7 @@ status () { fi INSTALLED=0 for installed_server in "${INSTALLED_SERVERS[@]}"; do - if [[ $server = "$installed_server" ]]; then + if [ "$server" == "$installed_server" ]; then INSTALLED=1 if [ -z "$VERSION" ]; then VERSION="UNKNOWN"