[BUG] Conflict with Docker Extension Prevents Formatting of docker-compose.yaml and Dockerfile
Hello,
I am experiencing an issue where the installation of the YAML extension seems to interfere with the Docker extension's ability to format docker-compose.yaml and Dockerfile.
Describe the bug
After installing the YAML extension, the Docker extension (ms-azuretools.vscode-docker) can no longer format docker-compose.yaml and Dockerfile. An error message is displayed: "No formatter installed for 'dockerfile/dockercompose' files." This issue does not occur until the YAML extension is installed, suggesting a conflict between the two extensions.
Steps to Reproduce
- Ensure the Docker extension from Microsoft is installed and functioning correctly: ms-azuretools.vscode-docker
- Install the YAML extension.
- Open a
docker-compose.yamlorDockerfile. - Attempt to format the file using VSCode's Format Document feature.
Environment
- VSCode Version:
1.85.1 - OS:
macOSWindows - Docker Extension Version:
v1.28.0 - YAML Extension Version:
v1.14.0
Bump +1 Same issue, verry annoying, please fix
@msivasubramaniaan sorry for pining you, could someone have a look at this issue please?
It's a deal breaker and has a serious impact on the developer experience. :/
Does anyone have a solution? I have been manually formatting docker-compose.yml for a long time. 😭
Unfortunately, no. This issue is so annoying but it seems the RedHat people are not actively maintaining this package.
If anyone has a contact with them please ping them.
Workaround:
Add the following to your user or workspace settings.json:
"files.associations": {
"docker-compose.y*ml": "yaml"
}
NOTE: In addition to Red Hat's yaml extension, I use remcohaszing.schemastore for automatic JSON schema validation in most yaml, json and toml files - no idea whether this works without.