cuelang / cue

CUE has moved to https://github.com/cue-lang/cue
https://cuelang.org
Apache License 2.0
3.09k stars 171 forks source link

`cue fix` tries to align comments inside braces with those outside, causing weird field indentation #1006

Closed zellyn closed 3 years ago

zellyn commented 3 years ago

What version of CUE are you using (cue version)?

$ cue version
cue version 0.4.0 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

indent-bug-repro.cue:

x: {
    y: string

    // Comment
    z: string
} | "long_string_to_push_out_the_comment_on_this_line" // Comment

cue fix indent-bug-repro.cue

What did you expect to see?

The same output as input

What did you see instead?

x: {
    y: string

                            // Comment
                            z: string
} | "long_string_to_push_out_the_comment_on_this_line" // Comment
cueckoo commented 3 years ago

This issue has been migrated to https://github.com/cue-lang/cue/issues/1006.

For more details about CUE's migration to a new home, please see https://github.com/cue-lang/cue/issues/1078.