aboutsummaryrefslogtreecommitdiffstats
path: root/lua/pi/lsp/null-ls.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/pi/lsp/null-ls.lua')
-rw-r--r--lua/pi/lsp/null-ls.lua63
1 files changed, 63 insertions, 0 deletions
diff --git a/lua/pi/lsp/null-ls.lua b/lua/pi/lsp/null-ls.lua
index 7e7888d..3026bd4 100644
--- a/lua/pi/lsp/null-ls.lua
+++ b/lua/pi/lsp/null-ls.lua
@@ -39,6 +39,69 @@ null_ls.setup {
},
null_ls.builtins.formatting.pint,
null_ls.builtins.formatting.clang_format,
+ null_ls.builtins.formatting.prettier.with {
+ extra_args = {
+ "--print-width",
+ "100",
+ "--tab-width",
+ "2",
+ "--single-quote",
+ "true",
+ "--trailing-comma",
+ "all",
+ "--arrow-parens",
+ "always",
+ "--semi",
+ "false",
+ "--bracket-spacing",
+ "false",
+ "--jsx-single-quote",
+ "true",
+ "--end-of-line",
+ "lf",
+ },
+ },
+ -- Opciones avanzadas de Black:
+ -- --line-length 100: ancho máximo de línea
+ -- --fast: omite comprobaciones de seguridad
+ -- --skip-string-normalization: no cambia comillas
+ -- --skip-magic-trailing-comma: ignora trailing comma mágica
+ -- --target-version py310: versión objetivo de Python 3.10
+ -- --preview: activa funciones experimentales
+ -- --diff: muestra el diff en vez de modificar archivos
+ -- --quiet: suprime la salida normal
+ -- --color: colorea el diff
+ -- --exclude ".*test.*": excluye archivos que coincidan con el patrón
+ null_ls.builtins.formatting.black.with {
+ extra_args = {
+ "--line-length",
+ "100",
+ -- "--fast",
+ "--skip-string-normalization",
+ "--skip-magic-trailing-comma",
+ "--target-version",
+ "py312",
+ -- "--preview",
+ -- "--diff",
+ -- "--quiet",
+ -- "--color",
+ "--exclude",
+ ".*test.*",
+ },
+ },
+ -- Assembly formatter
+ {
+ name = "asmfmt",
+ method = null_ls.methods.FORMATTING,
+ filetypes = { "asm", "s", "S" },
+ generator = null_ls.formatter {
+ command = "asmfmt",
+ to_stdin = true,
+ condition = function()
+ return vim.fn.executable "asmfmt" == 1
+ end,
+ },
+ },
-- null_ls.builtins.formatting.clang_format.with {
-- extra_args = { "--style={IndentWidth: 4}" },
-- },