add formatter

This commit is contained in:
Rikuoh Tsujitani 2023-11-03 18:45:54 +09:00
parent 262a39cbfb
commit 7125dcfb93
Signed by: riq0h
GPG key ID: 010F09DEA298C717

View file

@ -340,7 +340,7 @@ vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false }) vim.lsp.diagnostic.on_publish_diagnostics, { virtual_text = false })
require('mason').setup() require('mason').setup()
require("mason-null-ls").setup({ require("mason-null-ls").setup({
ensure_installed = { 'prettierd', 'rubocop' }, ensure_installed = { 'prettierd', 'rubocop', 'black', 'goimports' },
handlers = {}, handlers = {},
}) })
require('mason-lspconfig').setup() require('mason-lspconfig').setup()
@ -360,12 +360,11 @@ if (not status) then return end
null_ls.setup({ null_ls.setup({
sources = { sources = {
null_ls.builtins.diagnostics.eslint.with({
prefer_local = 'node_modules/.bin',
}),
null_ls.builtins.formatting.prettierd, null_ls.builtins.formatting.prettierd,
null_ls.builtins.diagnostics.rubocop, null_ls.builtins.diagnostics.rubocop,
null_ls.builtins.formatting.rubocop, null_ls.builtins.formatting.rubocop,
null_ls.builtins.formatting.black,
null_ls.builtins.formatting.goimports,
}, },
debug = false, debug = false,
}) })