Optional sorting of the fields in the YAML editor #1427
Merged
+274
−39
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 pull request introduces a new feature that allows users to toggle YAML key sorting in the resource editor, alongside improvements to how YAML drafts are managed when switching between sorted and unsorted views. The changes ensure that users can safely toggle sorting without losing unsorted edits, and the UI now provides a checkbox for this option.
YAML Sorting Feature:
sortKeysproperty toEditResourceModel, with an action handler to toggle sorting and regenerate YAML accordingly.savedUnsortedYaml) when the sort option is toggled, preventing loss of unsorted edits. [1] [2]sortKeystoyaml.dumpin both regeneration and managed fields toggle flows. [1] [2]UI Enhancements:
These changes improve the editing experience by giving users control over YAML key order and ensuring their edits are preserved when switching between sorted and unsorted views.