This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
How to configure Prisma formatter with null-ls? #929
Answered
by
fitrh
vicentematus
asked this question in
Q&A
-
I'm trying to setup null-ls with prismaFmt (which they show in the builtins). Here is my config: local null_ls = require("null-ls")
local formatting = null_ls.builtins.formatting
local sources = {
formatting.prettierd,
formatting.stylua,
null_ls.builtins.code_actions.eslint_d,
formatting.prismaFmt,
}
null_ls.setup({
sources = sources,
-- Para poder formatear on save
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 = function()
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
vim.lsp.buf.format({
bufnr = bufnr,
filter = function(client)
return client.name == "null-ls"
end,
})
end,
})
end
end,
})
As you there is Whenever i try to save with [null-ls] [ERROR 21:42:00] ...t/null-ls.nvim/lua/null-ls/helpers/generator_factory.lua:180: command prisma-fmt is not executable (make sure it's installed and on your $PAT How can i fix this? I'm supposed to install prismaFmt? |
Beta Was this translation helpful? Give feedback.
Answered by
fitrh
Jun 23, 2022
Replies: 1 comment 4 replies
-
Yes, you are always need to install formatter/linter, null-ls is the bridge between formatter/linter with neovim |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
vicentematus
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you are always need to install formatter/linter, null-ls is the bridge between formatter/linter with neovim