Developer QOL: Integrate Run on Save. #1294
Merged
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.
Pull Request Description
This PR is a followup to #1264 and #1277. Using the Run on Save extension, we can essentially close the loop with regards to quickly and easily adding new translations. Run on Save allows us to execute an arbitrary script upon saving a matching set of files. I have it set up to match
.arb
files and perform the following steps.arb_utils
package (should be a no-op if already installed)arb_utils generate-meta
(ensures that all keys have the metadata key, which is not added automatically byi18n-ally
)arb_utils sort
(self-explanatory)flutter gen-l10n
If there are errors with any of these steps (like the recent issue with activating
arb_utils
) it should not affect the developer. If needed, the logs can be found in the Output window.As before, these new entries in
settings.json
only affect developers using VS Code and only those with the Run on Save extension installed.P.S. Can you verify that these commands run successfully on Mac as well?
Screenshots / Recordings
Here is a full demo of the end-to-end workflow. You can see how easy things are now! 😊
run-on-save.mp4