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

Format object patterns. #1385

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Format object patterns. #1385

merged 1 commit into from
Feb 15, 2024

Conversation

kallentu
Copy link
Member

  • Added ObjectPatterns to canBlockSplit.
  • Migrated object pattern tests and object patterns with comments tests.

There's one test case in there that's not great, but I think it's a general problem with ListPattern, MapPattern too.
Maybe revisit it with the other patterns in another CL.

>>> Split in type argument.
if (obj case LongClassName<First, Second>()) {;}
<<<
### TODO(tall): It formats like this if there's no elements. Similarly with lists, maps etc.
if (obj
    case LongClassName<
        First,
        Second
        >()) {
  ;
}

@munificent
Copy link
Member

TODO(tall): It formats like this if there's no elements. Similarly with lists, maps etc.

if (obj
case LongClassName<
First,
Second
>()) {
;
}

Yeah, that looks like an ugly corner case of the collapsible indentation stuff I did. Leaving a TODO sounds good. I'll try to take a look at some point.

@kallentu kallentu merged commit 50e1248 into main Feb 15, 2024
7 checks passed
@kallentu kallentu deleted the object-pattern branch February 15, 2024 20:54
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.

3 participants