From 9e0f8b87faeebad40e106ad5776813d306ff683c Mon Sep 17 00:00:00 2001 From: marvelman3284 Date: Wed, 31 Mar 2021 04:05:15 -0400 Subject: [PATCH] Add support for the python language server --- install.sh | 14 +++++++++++++- lua/nvim-lspconfig/lua.lua | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 9307287..938da78 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ BASE=$(git rev-parse --show-toplevel) LSP_BIN_PATH=$HOME/.local/bin -default_lsp_langs="css html ts rust" +default_lsp_langs="css html ts rust python" lsp_langs=${@:-"$default_lsp_langs"} pfx="~~~~~ " @@ -63,6 +63,14 @@ install_node_deps () { sudo npm install -g $@ } +install_python_deps () { + if [[ -z $(which pip) ]]; then + echo "python/pip not installed" + return + fi + sudo python3 -m pip install $@ +} + install_ts() { install_node_deps typescript typescript-language-server prettier } @@ -86,6 +94,10 @@ install_rust() { fi } +install_python(){ + install_python_deps 'python-language-server[all]' +} + for lang in ${lsp_langs}; do if fn_exists install_$lang ; then heading "Installing $lang language server" diff --git a/lua/nvim-lspconfig/lua.lua b/lua/nvim-lspconfig/lua.lua index 6042601..7a447f2 100644 --- a/lua/nvim-lspconfig/lua.lua +++ b/lua/nvim-lspconfig/lua.lua @@ -32,3 +32,4 @@ buf_set_keymap("n", "q", "lua vim.lsp.diagnostic.set_loclist()", require "lspconfig".tsserver.setup {} require "lspconfig".cssls.setup {} require "lspconfig".html.setup {} +require "lspconfig".pyls.setup {}