I would like to request a new feature for the VS Code Docker extension that allows for automatic sorting of keywords in Docker Compose files.
Current Behavior
When copying and pasting Docker Compose configurations from various sources (e.g., GitHub repositories), the order of keywords within service definitions is often inconsistent. This inconsistency makes it challenging to quickly read and understand the configuration, especially when working with multiple services or comparing different Compose files.
Proposed Feature
Add an option to automatically sort the keywords within each service definition in a Docker Compose file. This feature would:
Allow users to define a custom sorting order for keywords.
Provide a default sorting order (e.g., image, container_name, environment, volumes, ports, etc.).
Be accessible through a command in the Command Palette or a context menu option when editing Docker Compose files.
I would like to request a new feature for the VS Code Docker extension that allows for automatic sorting of keywords in Docker Compose files.
Current Behavior
When copying and pasting Docker Compose configurations from various sources (e.g., GitHub repositories), the order of keywords within service definitions is often inconsistent. This inconsistency makes it challenging to quickly read and understand the configuration, especially when working with multiple services or comparing different Compose files.
Proposed Feature
Add an option to automatically sort the keywords within each service definition in a Docker Compose file. This feature would:
Example
Before sorting:
After sorting (with a predefined order):
Benefits
Implementation Suggestions