@@ -13,13 +13,15 @@ require("mason").setup({
1313require (" mason-lspconfig" ).setup ({
1414 ensure_installed = {
1515 " ruff" ,
16- " pyright " ,
16+ " ruff-lsp " ,
1717 " lua_ls" ,
1818 " rust_analyzer" ,
1919 " ts_ls" ,
2020 " gopls" ,
2121 " terraformls" ,
2222 " tflint" ,
23+ " basedpyright" ,
24+ " pylsp" ,
2325 },
2426})
2527
@@ -108,21 +110,19 @@ vim.lsp.config.ruff = {
108110}
109111vim .lsp .enable (" ruff" )
110112
111- -- Pyright for go-to-definition, hover, type checking
112- vim .lsp .config .pyright = {
113- cmd = { " pyright-langserver" , " --stdio" },
113+ vim .lsp .config .basedpyright = {
114+ cmd = { " basedpyright-langserver" , " --stdio" },
114115 filetypes = { " python" },
115- root_markers = {
116- " pyrightconfig.json" ,
117- " pyproject.toml" ,
118- " setup.py" ,
119- " .git" ,
120- },
116+ root_markers = { " pyrightconfig.json" , " pyproject.toml" , " setup.py" , " .git" },
121117 capabilities = capabilities ,
122118 on_attach = on_attach ,
123119 settings = {
124- pyright = {
125- disableOrganizeImports = true , -- Let ruff handle this
120+ basedpyright = {
121+ analysis = {
122+ typeCheckingMode = " basic" , -- or "off" if still too noisy
123+ diagnosticMode = " openFilesOnly" ,
124+ useLibraryCodeForTypes = true ,
125+ },
126126 },
127127 python = {
128128 analysis = {
@@ -133,8 +133,16 @@ vim.lsp.config.pyright = {
133133 },
134134 },
135135}
136- vim .lsp .enable (" pyright" )
137-
136+ vim .lsp .enable (" basedpyright" )
137+ vim .lsp .config .pylsp = {
138+ cmd = { " pylsp" },
139+ filetypes = { " python" },
140+ root_markers = { " pyproject.toml" , " .git" },
141+ capabilities = capabilities ,
142+ on_attach = on_attach ,
143+ settings = {},
144+ }
145+ vim .lsp .enable (" pylsp" )
138146-- TypeScript/JavaScript
139147vim .lsp .config .ts_ls = {
140148 cmd = { " typescript-language-server" , " --stdio" },
0 commit comments