Use pyright (and django-stubs), much better

This commit is contained in:
Loïc Gremaud 2024-09-02 19:46:57 +02:00
parent 258b42a1d5
commit f3bf598361
Signed by: Legrems
GPG Key ID: D4620E6DF3E0121D
2 changed files with 32 additions and 30 deletions

View File

@ -22,40 +22,41 @@ local handlers = {
["textdocument/signaturehelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = "rounded" }),
}
-- require("lspconfig").pyright.setup {
-- on_init = nvlsp.on_init,
-- on_attach = nvlsp.on_attach,
-- capabilities = nvlsp.capabilities,
-- handlers = handlers,
--
-- settings = {
-- pyright = {
-- -- options available here: https://github.com/microsoft/pyright/blob/main/docs/settings.md
-- disableorganizeimports = true, -- using ruff
-- -- disablelanguageservices = true, -- using ruff
-- },
-- python = {
-- analysis = {
-- -- ignore = { "*" }, -- using ruff
-- -- typecheckingmode = "off", -- using mypy
-- diagnosticseverityoverrides = {
-- reportmissingimports = false,
-- -- reportattributeaccessissue = false,
-- },
-- },
-- },
-- },
-- }
require("lspconfig").pyright.setup {
on_init = nvlsp.on_init,
on_attach = nvlsp.on_attach,
capabilities = nvlsp.capabilities,
handlers = handlers,
require("lspconfig").pylsp.setup {
settings = {
pylsp = {
plugins = {
pycodestyle = {
ignore = { "W391", "E501" },
maxLineLength = 100,
pyright = {
-- options available here: https://github.com/microsoft/pyright/blob/main/docs/settings.md
disableorganizeimports = true, -- using ruff
-- disablelanguageservices = true, -- using ruff
},
python = {
analysis = {
-- ignore = { "*" }, -- using ruff
-- typecheckingmode = "off", -- using mypy
diagnosticseverityoverrides = {
reportmissingimports = false,
-- reportattributeaccessissue = false,
reportUnusedVariable = false,
},
},
},
},
}
-- require("lspconfig").pylsp.setup {
-- settings = {
-- pylsp = {
-- plugins = {
-- pycodestyle = {
-- ignore = { "W391", "E501" },
-- maxLineLength = 100,
-- },
-- },
-- },
-- },
-- }

View File

@ -190,6 +190,7 @@ return {
{
"nvim-treesitter/nvim-treesitter-textobjects",
lazy = false,
config = function()
require("nvim-treesitter.configs").setup(require "configs.treesitter_textobjects")
end,