zapling / mason-conform.nvim

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

Check if the tool is already installed #4

Closed LeonardoMor closed 3 months ago

LeonardoMor commented 3 months ago

Some tools will be present on the conform config but do not need to be installed by Mason. For example, I might have prettier installed system-wide. Or jq or xmllint.

It will be beneficial to try to detect, any given tool, whether it is already installed or not. This will avoid duplicates and desired behavior.

zapling commented 3 months ago

Do you think some kind of ignore list would be enough?

I personally have my mason install path added to my system path. This way I just let mason handle all my tools that nvim uses, and I get the benefit of having all my tool versions under version control with https://github.com/zapling/mason-lock.nvim.

LeonardoMor commented 3 months ago

It didn't occur to me, but an ignore list is probably the most satisfying solution and the easiest to implement :)

zapling commented 3 months ago

@LeonardoMor this should now be resovled with the latest commit on main :) https://github.com/zapling/mason-conform.nvim/commit/882a4449e5a2e81f5441d837d74d356e03617660

zapling commented 3 months ago

You can now pass in an optional { ignore_install = {'prettier'} } when calling the setup function.