Skip to content

Refine edge-case comment handling for PatternMatchClass #6880

@charliermarsh

Description

@charliermarsh

In this case, comments a and b are leading on 2, but should be leading on a node for the entire b=2 (this requires an AST change):

    case A(
        b # b
        = # c
        2 # d
        # e
    ):
        pass

In this case, the comment should be an open parenthesis comment on the arguments, but is currently a leading comment on x due to our generic parenthesized comment handling (which thinks x is parenthesized, rather than in a call) (this requires an AST change):

    case Point2D(  # end of line line
            x
            ):
        ...

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingformatterRelated to the formatter

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions