redhat-developer / vscode-yaml

YAML support for VS Code with built-in kubernetes syntax support
MIT License
629 stars 214 forks source link

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

Open LisonFan opened 6 months ago

LisonFan commented 6 months ago

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

hexxone commented 4 months ago

Bump +1 Same issue, verry annoying, please fix

XhmikosR commented 4 months ago

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

IvanLi-CN commented 3 months ago

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

XhmikosR commented 3 months ago

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.

nilreml commented 2 months ago

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.