microsoft/compose-language-service

Compose formatter: YAML anchors broken by formatting

justinbowes opened this issue · 1 comments

YAML fragments are supported in docker-compose.yaml.

The following minimal example has its &anchor broken when formatted:

version: "3.5"

x-anchor: &anchor
  FOO: bar

services:
  example:
    image: alpine

Formatting makes the following change:

version: "3.5"

x-anchor: 
  &anchor
  FOO: bar

services:
  example:
    image: alpine

I would expect the compose formatter to not insert newlines that break supported syntax.

Thanks @justinbowes! I'll move this to the compose language service repository.