This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
-
I have installed I just want And my return {
'jose-elias-alvarez/null-ls.nvim',
config = function()
local null_ls = require("null-ls")
local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local format = function(payload)
vim.lsp.buf.format({
async = false,
})
end
null_ls.setup({
debug = false,
sources = {
formatting.markdownlint,
formatting.eslint_d,
diagnostics.eslint_d,
},
-- you can reuse a shared lspconfig on_attach callback here
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = format,
})
end
end,
})
null_ls.builtins.formatting.eslint_d.with({
extra_args = {
"--style",
"{IndentWidth: 2 ,ColumnLimit: 120}",
},
})
end
} |
Beta Was this translation helpful? Give feedback.
Answered by
lcoder
May 17, 2023
Replies: 1 comment 1 reply
-
try comment this line
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
guxuerui
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try comment this line