I use lsp-zero to configure lsp in nvim. Besides Mason.
In Ale this works for formatting when saving sql files.
let g:ale_fixers = {
'sql' : [ 'pgformatter']
}
Go, Rust and Lua format files when saving, but it doesn’t work with pgformatter.
lsp.format_on_save({
servers = {
['lua_ls'] = { 'lua' },
['rust_analyzer'] = { 'rust' },
['gopls'] = { 'go' },
['pgformatter'] = { 'sql' },
}
})
Any ideas on how I can do this?