Add .local/bin/update_lsps

This commit is contained in:
Lewis Wynne 2025-11-01 03:51:15 +00:00
parent b3d304bbbb
commit a3e2a3555f

View file

@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
echo "Installing/updating LSPS."
echo
declare -A LSPS=(
["astro"]="sudo npm i -g @astrojs/language-server"
["bash"]="sudo npm i -g bash-language-server"
["css,html,json"]="sudo npm i -g vscode-langservers-extracted"
["markdown"]="yay -S marksman-bin"
["rust"]="rustup component add rust-analyzer"
["tailwindcss"]="sudo npm i -g @tailwindcss/language-server"
["toml"]="cargo install taplo-cli --locked --features lsp"
["typescript"]="sudo npm install -g typescript typescript-language-server"
["yaml"]="sudo npm i -g yaml-language-server@next"
)
for lsp in "${!LSPS[@]}"; do
echo -n "install/update ${lsp}? (y/n): "
read -r ans
if [[ "$ans" =~ ^[Yy]$ ]]; then
echo "-> updating ${lsp}..."
eval "${LSPS[$lsp]}"
echo "-> ${lsp} done"
else
echo "-> skipping ${lsp}"
fi
echo
done
echo "done"