feat: add more sophisticated formatter selection #275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds an algorithm, that searches for the best available formatter. This results in the following behavior:
if
formatting.provider
is set tonull
we try to find a formatter in the following order["meson", "muon"
], if one of them is found in this order, that one is usedif
formatting.provider
is set to"meson"
we try to find a formatter in the following order["meson", "muon"
], even if we set the provider to be"meson"
and meson is not found, muon is usedThe same for muon, it is a priority if the user selected it, but meson might be used, if muon is not found
The only problem I can see, if you want to disable the formatter, there is no way of doing that, but that was previously also not the case.
fixes #274
Let me know, me if this solution is acceptable. The problem with the previous code is, that it wasn't really designed to handle multiple formatting providers that well.