From 9a2b54fda164996e03bacb2eb2076ca4c4479989 Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Wed, 19 Jun 2024 15:51:34 -0500 Subject: feat(nvim): switch python lsp to basedpyright with inlay type hints --- dot_config/nvim/lua/plugins/lsp-zero.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'dot_config/nvim/lua') diff --git a/dot_config/nvim/lua/plugins/lsp-zero.lua b/dot_config/nvim/lua/plugins/lsp-zero.lua index 0cc0bfe..b58284e 100644 --- a/dot_config/nvim/lua/plugins/lsp-zero.lua +++ b/dot_config/nvim/lua/plugins/lsp-zero.lua @@ -44,13 +44,25 @@ return { require('mason-lspconfig').setup({ ensure_installed = { - 'pyright', + 'basedpyright', 'ruff_lsp', 'tsserver', 'lua_ls', }, handlers = { lsp_zero.default_setup, + basedpyright = function() + local basedpyright_opts = { + settings = { + basedpyright = { + -- Type checking is very strict by default. Standard is a good balance. + typeCheckingMode = "standard", + } + } + } + require('lspconfig').basedpyright.setup(basedpyright_opts) + + end, lua_ls = function() -- (Optional) Configure lua langauge server for neovim local lua_opts = lsp_zero.nvim_lua_ls() @@ -63,6 +75,8 @@ return { underline = false, }) + vim.lsp.inlay_hint.enable() + end, }, -- cgit v1.2.3