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", }, }, }, }