zapling / mason-conform.nvim

Automatically install formatters registered with conform.nvim via mason.nvim
Apache License 2.0
41 stars 1 forks source link

Support sublists (e.g. `{ { "prettierd", "prettier" } }`) #1

Closed datwaft closed 5 months ago

datwaft commented 5 months ago

When trying your plugin I saw that it didn't support sublists, which I use for prettier.

As you can see conform.nvim's documentation shows an example:

require("conform").setup({
  formatters_by_ft = {
    lua = { "stylua" },
    -- Conform will run multiple formatters sequentially
    python = { "isort", "black" },
    -- Use a sub-list to run only the first available formatter <- See this
    javascript = { { "prettierd", "prettier" } },
  },
})

I tested this PR locally and it seems to work and doesn't cause any regression (at least for my configuration).

zapling commented 5 months ago

Wops, didn't not mean to close... I made minor changes that I pushed and somehow github thought it was a good idea to close then.

zapling commented 5 months ago

Sorry not used to working with forks, I have your commit locally now, which I thought I pushed to your fork, will see if I can manage to untangle this and get it pushed again, otherwise I'll just cherry-pick it onto main directly.

zapling commented 5 months ago

Trying to reopen

zapling commented 5 months ago

Thank you for the contribution, your fix is now in the main branch https://github.com/zapling/mason-conform.nvim/commit/c41b19222db71b016e55c64454b5e03441f56859. I'm sorry but I messed up your fork so it lost the commit, and since the PR got auto closed I lost the permission to push to it, so was unable to fix it.

datwaft commented 5 months ago

No problem, thank you for merging!