Update: 2024-10-31

This commit is contained in:
2024-10-31 21:01:09 +02:00
parent 814425e4b7
commit 1f6468b827
9 changed files with 82 additions and 53 deletions

View File

@@ -0,0 +1,16 @@
local M = {}
M.setup = function(lsp, capabilities)
lsp.basedpyright.setup({
capabilities = capabilities,
basedpyright = {
analysis = {
autoSearchPaths = true,
diagnosticMode = "openFilesOnly",
useLibraryCodeForTypes = true,
},
},
})
end
return M

View File

@@ -0,0 +1,17 @@
local M = {}
M.setup = function(lsp, capabilities)
lsp.pylyzer.setup({
capabilities = capabilities,
settings = {
python = {
diagnostics = true,
inlayHints = true,
smartCompletion = true,
checkOnType = true,
},
},
})
end
return M

View File

@@ -1,14 +0,0 @@
local M = {}
M.setup = function(lsp, capabilities)
capabilities = capabilities
lsp.ruff_lsp.setup({
init_options = {
settings = {
args = {},
},
},
})
end
return M

View File

@@ -135,7 +135,8 @@ return {
"emmet_ls",
"html",
"jedi_language_server",
"tinymist",
-- "basedpyright",
-- "tinymist",
"lua_ls",
"tailwindcss",
"texlab",
@@ -161,8 +162,11 @@ return {
htmx = function()
lsp.htmx.setup(html_opts)
end,
ruff_lsp = function()
require("plugins.lsp.ruff").setup(lsp, lsp_capabilities)
pylyzer = function()
require("plugins.lsp.pylyzer").setup(lsp, lsp_capabilities)
end,
basedpyright = function()
require("plugins.lsp.basedpyright").setup(lsp, lsp_capabilities)
end,
jinja_lsp = function()
lsp.jinja_lsp.setup(html_opts)

View File

@@ -19,7 +19,7 @@ return {
languages = {
python = {
template = {
annotation_convention = "google_docstrings", -- google_docstrings, numpydoc, reST
annotation_convention = "numpydoc", -- google_docstrings, numpydoc, reST
},
},
},

View File

@@ -37,7 +37,12 @@ vim.api.nvim_create_autocmd({ "TextYankPost" }, {
-- Format File on Save
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
callback = function()
vim.lsp.buf.format()
local file_path = vim.fs.normalize(vim.fn.expand("%:p")):lower()
local exclude_pattern = "dio"
if not string.match(file_path:lower(), exclude_pattern:lower()) then
vim.lsp.buf.format()
end
end,
})