vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

[BUG] Conflict with Docker Extension Prevents Formatting of docker-compose.yaml and Dockerfile

Open LisonFan opened this issue 2 years ago • 8 comments

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. image image image

Steps to Reproduce

  1. Ensure the Docker extension from Microsoft is installed and functioning correctly: ms-azuretools.vscode-docker
  2. Install the YAML extension.
  3. Open a docker-compose.yaml or Dockerfile.
  4. Attempt to format the file using VSCode's Format Document feature.

Environment

  • VSCode Version: 1.85.1
  • OS: macOS Windows
  • Docker Extension Version: v1.28.0
  • YAML Extension Version: v1.14.0

LisonFan avatar Dec 30 '23 15:12 LisonFan

Bump +1 Same issue, verry annoying, please fix

hexxone avatar Feb 11 '24 15:02 hexxone

@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. :/

XhmikosR avatar Mar 02 '24 12:03 XhmikosR

Does anyone have a solution? I have been manually formatting docker-compose.yml for a long time. 😭

IvanLi-CN avatar Mar 30 '24 06:03 IvanLi-CN

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.

XhmikosR avatar Mar 30 '24 06:03 XhmikosR

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.

nilreml avatar Apr 29 '24 18:04 nilreml