init
This commit is contained in:
113
nvim/lua/plugins/extras/lang/python-extended.lua
Normal file
113
nvim/lua/plugins/extras/lang/python-extended.lua
Normal file
@@ -0,0 +1,113 @@
|
||||
local package_prefix = "<leader>pp"
|
||||
|
||||
-- LSP Server to use for Python.
|
||||
-- Set to "basedpyright" to use basedpyright instead of pyright.
|
||||
vim.g.lazyvim_python_lsp = "basedpyright"
|
||||
vim.g.lazyvim_python_ruff = "ruff"
|
||||
|
||||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
---@type lspconfig.options.basedpyright
|
||||
basedpyright = {
|
||||
settings = {
|
||||
basedpyright = {
|
||||
analysis = {
|
||||
diagnosticSeverityOverrides = {
|
||||
reportUnusedCallResult = "information",
|
||||
reportUnusedExpression = "information",
|
||||
reportUnknownMemberType = "none",
|
||||
reportUnknownLambdaType = "none",
|
||||
reportUnknownParameterType = "none",
|
||||
reportMissingParameterType = "none",
|
||||
reportUnknownVariableType = "none",
|
||||
reportUnknownArgumentType = "none",
|
||||
reportAny = "none",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
---@type lspconfig.options.pyright
|
||||
pyright = {
|
||||
settings = {
|
||||
verboseOutput = true,
|
||||
autoImportCompletion = true,
|
||||
python = {
|
||||
analysis = {
|
||||
diagnosticSeverityOverrides = {
|
||||
reportWildcardImportFromLibrary = "none",
|
||||
reportUnusedImport = "information",
|
||||
reportUnusedClass = "information",
|
||||
reportUnusedFunction = "information",
|
||||
},
|
||||
typeCheckingMode = "strict",
|
||||
autoSearchPaths = true,
|
||||
useLibraryCodeForTypes = true,
|
||||
diagnosticMode = "openFilesOnly",
|
||||
indexing = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
[vim.g.lazyvim_python_ruff] = {
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function() end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"requirements",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/py-requirements.nvim",
|
||||
event = {
|
||||
"BufRead requirements.txt",
|
||||
},
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {},
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "py-requirements" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ package_prefix .. "u", function() require("py-requirements").upgrade() end, desc = "Update Package" },
|
||||
{ package_prefix .. "i", function() require("py-requirements").show_description() end, desc = "Package Info" },
|
||||
{ package_prefix .. "a", function() require("py-requirements").upgrade_all() end, desc = "Update All Packages" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ "<leader>p", group = "packages/dependencies", icon = " " },
|
||||
{ package_prefix, group = "python", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"python-3.11",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user