mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-25 10:18:42 +02:00
custom config null-ls
This commit is contained in:
parent
ca7eebe161
commit
bfff75c0a4
2 changed files with 31 additions and 13 deletions
8
lua/custom/null-ls.lua
Normal file
8
lua/custom/null-ls.lua
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local formatting = null_ls.builtins.formatting
|
||||||
|
local m = {
|
||||||
|
sources = {
|
||||||
|
formatting.stylua, -- tambahkan di bawah sini
|
||||||
|
},
|
||||||
|
}
|
||||||
|
return m
|
|
@ -10,9 +10,19 @@ local diagnostics = null_ls.builtins.diagnostics
|
||||||
|
|
||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||||
|
|
||||||
|
local sources = {}
|
||||||
|
|
||||||
|
local data_exists, data = pcall(require, "custom.null-ls")
|
||||||
|
if data_exists then
|
||||||
|
for _, cfg in pairs(data.sources) do
|
||||||
|
table.insert(sources, cfg)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
debug = false,
|
debug = false,
|
||||||
sources = {
|
sources = sources,
|
||||||
|
--sources = {
|
||||||
--formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
|
--formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }),
|
||||||
--formatting.prettier,
|
--formatting.prettier,
|
||||||
-- formatting.prettierd,
|
-- formatting.prettierd,
|
||||||
|
@ -24,7 +34,7 @@ null_ls.setup({
|
||||||
-- formatting.clang_format,
|
-- formatting.clang_format,
|
||||||
-- diagnostics.flake8
|
-- diagnostics.flake8
|
||||||
-- diagnostics.eslint_d,
|
-- diagnostics.eslint_d,
|
||||||
},
|
--},
|
||||||
|
|
||||||
-- on_attach = function(client, bufnr)
|
-- on_attach = function(client, bufnr)
|
||||||
-- --if client.resolved_capabilities.document_formatting then
|
-- --if client.resolved_capabilities.document_formatting then
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue