This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
Replies: 1 comment
-
local sources = {
formatting.sql_formatter.with({
args = function(params)
-- check available fields - is there something here that can tell you which language you're using?
vim.inspect(params)
-- in your example, you could check params.cwd
local language = params.cwd:contains("sqlite") and "sqlite" or "postgresql"
return { "--language", language }
end,
}),
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have two files,
postgresql/queries/query.sql
andsqlite/queries/query.sql
I have this config and I have to change it manually each time i want to format sqlite or postgresql files.
Any idea?
Beta Was this translation helpful? Give feedback.
All reactions