Skip to content

Wrapping the first line of a multiline Python docstring #22

Closed

Description

@dannystewart

Greetings! First off, thank you for this extension, it's awesome and I use it on a daily basis. There's a situation I routinely run into with Python that breaks and needs to be fixed manually.

"""I have a docstring that starts like this and spans multiple lines and I want to reflow the first line so it wraps correctly.

Docstring continues...
"""

If I select the entire first line (by clicking the line number in the gutter) and hit Alt+Q to rewrap it:

"""I have a docstring that starts like this and spans multiple lines and I want to reflow the first
"""line so it wraps correctly.

Docstring continues...
"""

I have to remove the quotes it added on the next line. I think it's assuming it should be a single-line docstring and trying to close it.

I spent a few hours today to see if I could adjust the Python parser but ultimately had to admit defeat. I don't know F# but it seems like it could be related to how the regex capture groups handle docstrings, or it could be something in blockComment's overall processing.

It would be wonderfully helpful if this kind of docstring formatting could be supported and I really appreciate any time spent looking into it. Happy to help or test if needed.

Activity

  1. ellerychan commented on Sep 11, 2026

    @ellerychan

    Duplicate of Issue #10

  2. dnut commented on Oct 24, 2026

    @dnut
    Owner

    This has been fixed and released in version 18.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions