feat: add new feature format for meson 1.9.0 #291
+92
−58
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.
As meson 1.9.0 release recently, I took a look through the Release Notes
and I saw an interesting feature for formatting, you can now add the cli argument
--source-file-path
, when using stdin as input file. This helps for error generation. And since we use this feature and have the path available, we can use this in this extension.SO I added this feature, that, if we detect meson
1.9.0 >=
we use this feature.It required some type changes, but other than that, it only adds this functionality. Feel free to comment on how to better solve the "issue", that muon and meson have different options, but they land in the same array with tools, it uses generics and some casting in some places, to make this work, so that it is type safe (as every check and format function are in a pair, and return / accept the same type of option)