2024-09-16 18:45:39 -03:00
|
|
|
-- Customize None-ls sources
|
|
|
|
|
|
|
|
---@type LazySpec
|
|
|
|
return {
|
|
|
|
"nvimtools/none-ls.nvim",
|
2024-09-23 21:50:02 -03:00
|
|
|
dependencies = {
|
|
|
|
"nvimtools/none-ls-extras.nvim",
|
|
|
|
},
|
2024-09-16 18:45:39 -03:00
|
|
|
opts = function(_, config)
|
|
|
|
-- config variable is the default configuration table for the setup function call
|
|
|
|
local null_ls = require("null-ls")
|
2024-10-21 14:59:17 -03:00
|
|
|
local helpers = require("null-ls.helpers")
|
|
|
|
|
2025-01-21 03:47:05 -03:00
|
|
|
-- local deno_fmt = helpers.make_builtin({
|
|
|
|
-- name = "deno_fmt",
|
|
|
|
-- filetypes = {
|
|
|
|
-- "angular",
|
|
|
|
-- "astro",
|
|
|
|
-- "css",
|
|
|
|
-- "html",
|
|
|
|
-- "javascript",
|
|
|
|
-- "json",
|
|
|
|
-- "jsonc",
|
|
|
|
-- "less",
|
|
|
|
-- "markdown",
|
|
|
|
-- "sass",
|
|
|
|
-- "scss",
|
|
|
|
-- "svelte",
|
|
|
|
-- "typescript",
|
|
|
|
-- "vue",
|
|
|
|
-- "yaml",
|
|
|
|
-- },
|
|
|
|
-- method = { null_ls.methods.FORMATTING },
|
|
|
|
-- generator_opts = {
|
|
|
|
-- command = "deno",
|
|
|
|
-- args = { "fmt", "--unstable-component", "-" },
|
|
|
|
-- to_stdin = true,
|
|
|
|
-- },
|
|
|
|
-- factory = helpers.formatter_factory,
|
|
|
|
-- })
|
2024-09-16 18:45:39 -03:00
|
|
|
|
|
|
|
-- Check supported formatters and linters
|
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
|
|
|
config.sources = {
|
|
|
|
-- Set a formatter
|
2024-09-23 21:50:02 -03:00
|
|
|
require("none-ls.diagnostics.flake8"),
|
2024-09-30 19:28:55 -03:00
|
|
|
require("none-ls.formatting.ruff"),
|
2024-10-24 22:43:52 -03:00
|
|
|
null_ls.builtins.formatting.clang_format.with({
|
|
|
|
disabled_filetypes = { "cs" },
|
|
|
|
}),
|
2024-09-30 19:28:55 -03:00
|
|
|
null_ls.builtins.formatting.csharpier,
|
2024-09-16 18:45:39 -03:00
|
|
|
null_ls.builtins.formatting.nixfmt,
|
|
|
|
null_ls.builtins.formatting.stylua,
|
2025-01-21 03:47:05 -03:00
|
|
|
--deno_fmt,
|
|
|
|
null_ls.builtins.formatting.prettierd,
|
2024-09-16 18:45:39 -03:00
|
|
|
}
|
|
|
|
return config -- return final config table
|
|
|
|
end,
|
|
|
|
}
|