Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(format): indent list elements correctly #2645

Closed
wants to merge 1 commit into from

Conversation

uhthomas
Copy link
Contributor

Vertical tabs are not inserted when the next expression needs a form feed, but are erroneously inserted for expressions which hide the underlying type. This is fixed by recursively checking if expressions need a form feed.

Fixes: #2314

Vertical tabs are not inserted when the next expression needs a form feed, but
are erroneously inserted for expressions which hide the underlying type. This is
fixed by recursively checking if expressions need a form feed.

Fixes: cue-lang#2314

Signed-off-by: Thomas Way <[email protected]>
Copy link
Member

@mvdan mvdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does mean that we vertically align fields in fewer cases, but some of those were clearly broken like you show, so this definitely seems like a good step.

We can always tweak the heuristic to vertically align more often again in the future, bearing in mind to not break your added test cases.

@mvdan
Copy link
Member

mvdan commented Oct 20, 2023

Imported this PR into Gerrit as https://review.gerrithub.io/c/cue-lang/cue/+/1170966, since GitHub is a git mirror.

I can't review commit messages on GitHub PRs like on Gerrit, so I took the liberty to expand your commit message a bit to explain what I think is going on with the problem and your fix. Hope that's okay. You can always leave a review on the Gerrit CL if you would like it written differently :)

@mvdan
Copy link
Member

mvdan commented Oct 20, 2023

Also FYI, CI failed since go generate ./... resulted in a slight change in generated CUE. Fixed that in the CL.

@cueckoo cueckoo closed this in eddccfc Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cue/fmt: Lists are indented too much
2 participants