replace pyls with pyright

This commit is contained in:
siduck76 2021-04-08 07:29:39 +05:30
parent 58443f6d97
commit f5c59c574a
2 changed files with 18 additions and 28 deletions

View file

@ -7,14 +7,12 @@ lsp_langs=""
choose_langs() { choose_langs() {
read -p "Would you like to install $1 lsp?(y/n)" lang read -p "Would you like to install $1 lsp?(y/n)" lang
if [ "$lang" = "y" ] if [ "$lang" = "y" ]; then
then
lsp_langs+="$1 " lsp_langs+="$1 "
fi fi
} }
for lang in $default_lsp_langs for lang in $default_lsp_langs; do
do
choose_langs $lang choose_langs $lang
done done
@ -30,7 +28,7 @@ get_platform() {
Darwin*) platform=Mac ;; Darwin*) platform=Mac ;;
CYGWIN*) platform=Cygwin ;; CYGWIN*) platform=Cygwin ;;
MINGW*) platform=MinGw ;; MINGW*) platform=MinGw ;;
*) platform="UNKNOWN:${unameOut}" *) platform="UNKNOWN:${unameOut}" ;;
esac esac
echo $platform echo $platform
} }
@ -83,14 +81,6 @@ install_node_deps () {
sudo npm install -g $@ sudo npm install -g $@
} }
install_python_deps () {
if [[ -z $(which pip) && -z $(which pip3) ]]; then
echo "python/pip not installed"
return
fi
sudo python3 -m pip install $@
}
install_ts() { install_ts() {
install_node_deps typescript typescript-language-server prettier install_node_deps typescript typescript-language-server prettier
} }
@ -115,7 +105,7 @@ install_rust() {
} }
install_python() { install_python() {
install_python_deps 'python-language-server[all]' install_node_deps pyright
} }
for lang in ${lsp_langs}; do for lang in ${lsp_langs}; do
@ -128,7 +118,7 @@ for lang in ${lsp_langs}; do
fi fi
done done
if [[ ${warn_path} = true ]]; then if [[ ${warn_path} == true ]]; then
echo "" echo ""
echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable" echo "Ensure ${LSP_BIN_PATH} is available in your \$PATH variable"
fi fi

View file

@ -39,7 +39,7 @@ function on_attach(client)
end end
end end
local servers = {"tsserver", "cssls", "html" , "pyls"} local servers = {"tsserver", "cssls", "html" , "pyright"}
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {on_attach = on_attach} nvim_lsp[lsp].setup {on_attach = on_attach}
end end