Skip to content

How to do eg parenthesized_expression/binary_operator in python #25

@AckslD

Description

@AckslD

I recently added list comprehensions etc for python #24 which works nice. I also wanted to add support to turn eg

x = (1 + 1 + 1 + 1)

to

x = (
    1
    + 1
    + 1
    + 1
)

or

x = (
    1 +
    1 +
    1 +
    1
)

but this does not directly work in the current framework since the nodes we want to put on separate lines here are not the children of a single parent, they are rather in a tree of binary operations. Also the whitespace before/after the operator is tricky. Maybe nvim-treesitter/nvim-treesitter-textobjects#235 could help for the whitespace at least.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions