feat: update ls configs

This commit is contained in:
2024-06-12 09:06:56 +02:00
parent b404648928
commit ee7cfb9410
7 changed files with 255 additions and 119 deletions
+90 -9
View File
@@ -1,17 +1,89 @@
local utils = require("utils")
---@type ServerConfig
return {
enable = false,
dependencies = {
"python3",
dependencies = { "python3" },
mason = { "jedi-language-server" },
linters = {
{
cmd = {
"flake8",
"--max-line-length=100",
"--max-doc-length=100",
"--format",
"%(row)d,%(col)d,%(code).1s: %(text)s",
"-",
},
stdin = true,
stdout = true,
pattern = "^(%d+),(%d+),(%w): (.*)",
groups = { "lnum", "col", "severity", "message" },
source = "flake8",
severity_map = {
E = vim.diagnostic.severity.ERROR,
W = vim.diagnostic.severity.WARN,
B = vim.diagnostic.severity.HINT,
F = vim.diagnostic.severity.HINT,
D = vim.diagnostic.severity.INFO,
},
},
},
mason = {
name = "jedi-language-server",
-- version = "",
keymaps = {
{
mode = "n",
lhs = "<leader>lf",
rhs = function()
utils.format({
cmd = {
"black",
"--line-length",
"100",
"--stdin-filename",
"%filename%",
"--quiet",
"-",
},
stdin = true,
stdout = true,
})
utils.format({
cmd = {
"isort",
"--quiet",
"-",
},
stdin = true,
stdout = true,
})
end,
},
{
mode = "x",
lhs = "<leader>lf",
rhs = function()
utils.format({
cmd = {
"black",
"--line-length",
"100",
"--stdin-filename",
"%filename%",
"--quiet",
"--line-ranges=%row_start%-%row_end%",
"-",
},
stdin = true,
stdout = true,
})
end,
},
},
lspconfig = {
filetypes = {
"python",
},
cmd = { "jedi-language-server", },
cmd = { "jedi-language-server" },
single_file_support = true,
-- For more info see:
-- - https://github.com/pappasam/jedi-language-server#configuration
@@ -40,9 +112,18 @@ return {
-- If you manually set this option, it overrides the default.
-- Setting it to an empty array will result in no ignored folders.
ignoreFolders = {
".nox", ".tox", ".venv", "__pycache__", "venv",
"artifacts", "config", ".vscode", ".pytest_cache",
"build", "scripts", "incoax_tests.egg-info",
".nox",
".tox",
".venv",
"__pycache__",
"venv",
"artifacts",
"config",
".vscode",
".pytest_cache",
"build",
"scripts",
"incoax_tests.egg-info",
"node_modules",
},
},