Skip to content

Commit

Permalink
Adds prettier and removes no formatter found warning
Browse files Browse the repository at this point in the history
  • Loading branch information
usodst committed Mar 27, 2024
1 parent 5c5d489 commit 5827c22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ local plugins = {
},
},
null_ls.builtins.formatting.csharpier,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.terraform_fmt,
null_ls.builtins.formatting.yamlfmt,
Expand All @@ -43,7 +44,9 @@ local plugins = {
if client.supports_method "textDocument/formatting" then
vim.api.nvim_create_autocmd("BufWritePost", {
callback = function()
vim.lsp.buf.format()
if vim.lsp.buf_is_attached(0, 1) then -- check if none-ls is attached to the current buffer
vim.lsp.buf.format { async = false }
end
end,
})
end
Expand Down

0 comments on commit 5827c22

Please sign in to comment.