dotfiles/.config/nvim/lsp/basedpyright.lua
2026-03-07 16:11:49 -05:00

41 lines
1.1 KiB
Lua

return {
cmd = { "basedpyright-langserver", "--stdio" },
filetypes = { "python" },
root_markers = {
"pyproject.toml",
"setup.py",
"setup.cfg",
"requirements.txt",
"Pipfile",
"pyrightconfig.json",
".git",
},
on_attach = function(client, bufnr)
-- This specifically prevents BasedPyright from inserting a second bracket
client.server_capabilities.documentOnTypeFormattingProvider = false
end,
settings = {
basedpyright = {
analysis = {
diagnosticSeverityOverrides = {
reportAny = false,
reportOptionalOperand = "warning",
reportOptionalMemberAccess = false,
reportOptionalSubscript = false,
reportAttributeAccessIssue = false,
reportMissingTypeArgument = false,
reportMissingTypeStubs = false,
reportUnknownArgumentType = false,
reportUnknownMemberType = false,
reportUnknownParameterType = false,
reportUnknownVariableType = false,
reportUnusedCallResult = false,
},
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
typeCheckingMode = "basic",
},
},
},
}