Add rust-analyzer support
parent
020d00dbe7
commit
eecdb79987
|
@ -186,19 +186,22 @@ declare -A SUPPORTED_SERVERS=(
|
|||
["haskell"]="hls"
|
||||
["solidity"]="solang"
|
||||
["xml"]="lemminx"
|
||||
["kotlin"]="kotlin-language-server"
|
||||
["kotlin"]="kotlin-language-server",
|
||||
["rust"]="rust-analyzer"
|
||||
)
|
||||
declare -A LINK_SOURCES=(
|
||||
["omnisharp"]="$HOME/lsp/dotnet/omnisharp/run"
|
||||
["solang"]="$HOME/lsp/solidity/solang/solang"
|
||||
["lemminx"]="$HOME/lsp/xml/lemminx/lemminx"
|
||||
["kotlin-language-server"]="$HOME/lsp/kotlin/kotlin-language-server/bin/kotlin-language-server"
|
||||
["rust-analyzer"]="$HOME/lsp/rust/rust-analyzer/rust-analyzer"
|
||||
)
|
||||
declare -A LINK_TARGETS=(
|
||||
["omnisharp"]="$HOME/.local/bin/omnisharp"
|
||||
["solang"]="$HOME/.local/bin/solang"
|
||||
["lemminx"]="$HOME/.local/bin/lemminx"
|
||||
["kotlin-language-server"]="$HOME/.local/bin/kotlin-language-server"
|
||||
["rust-analyzer"]="$HOME/.local/bin/rust-analyzer"
|
||||
)
|
||||
|
||||
is_linked () {
|
||||
|
@ -383,6 +386,27 @@ install () {
|
|||
unzip /tmp/kotlin-language-server.zip -d /tmp/kotlin-language-server
|
||||
mv /tmp/kotlin-language-server/server $HOME/lsp/kotlin/kotlin-language-server
|
||||
;;
|
||||
rust-analyzer)
|
||||
if [ -z "$VERSION" ]; then
|
||||
VERSION="2021-11-15"
|
||||
fi
|
||||
BASE_FILE_NAME="rust-analyzer-x86_64"
|
||||
case $UNAME in
|
||||
Linux)
|
||||
FILE_NAME="${BASE_FILE_NAME}-unknown-linux-gnu.gz"
|
||||
;;
|
||||
Windows)
|
||||
FILE_NAME="${BASE_FILE_NAME}-pc-windows-msvc.gz"
|
||||
;;
|
||||
Darwin)
|
||||
FILE_NAME="${BASE_FILE_NAME}-apple-darwin.gz"
|
||||
;;
|
||||
esac
|
||||
wget -O - https://github.com/rust-analyzer/rust-analyzer/releases/download/$VERSION/$FILE_NAME > /tmp/rust-analyzer.gz
|
||||
mkdir -p $HOME/lsp/rust/rust-analyzer
|
||||
gunzip /tmp/rust-analyzer.gz -c > $HOME/lsp/rust/rust-analyzer/rust-analyzer
|
||||
chmod +x $HOME/lsp/rust/rust-analyzer/rust-analyzer
|
||||
;;
|
||||
*)
|
||||
echo "Unknown server: $SERVER"
|
||||
echo "Run 'lsp status --all' for a list of available servers"
|
||||
|
@ -421,6 +445,9 @@ uninstall () {
|
|||
kotlin-language-server)
|
||||
rm -rf $HOME/lsp/kotlin/kotlin-language-server
|
||||
;;
|
||||
rust-analyzer)
|
||||
rm -rf $HOME/lsp/rust/rust-analyzer
|
||||
;;
|
||||
*)
|
||||
echo "Unknown server: $SERVER"
|
||||
echo "Run 'lsp status' for a list of installed servers"
|
||||
|
|
Loading…
Reference in New Issue