Rewrap icon indicating copy to clipboard operation
Rewrap copied to clipboard

Python triple-quoted rewrap injects extra triple-quote, resulting in syntax error

Open biblicabeebli opened this issue 1 year ago • 4 comments

If you trigger rewrap while the cursor is inside a multiline triple-quote (in this case a python documentation comment) where the first line's length is over the character limit it all goes wrong.

  • It seems to rewrap that single line and inject the closing triple-quotes.
  • This particular example is with a 100 character wrap configuration.
  • Occurs with both single and double quotes (as it the ' and " characters).
def get_resendable_uuids(now, pushable_participant_pks):
    """ Get the uuids of relevant archives. This includes a per-study timeout value for how frequently
    to resend, and a filter by last updated time. """

The above gets rewrapped to:

def get_resendable_uuids(now, pushable_participant_pks):
    """ Get the uuids of relevant archives. This includes a per-study timeout value for how
    """ frequently
    to resend, and a filter by last updated time. """

which is a syntax error.


Tested version infos, via vscode:

Version 17.8.0 Last Updated 2024-12-16, 18:04:08

Version 1.16.3 Last Updated 2024-12-16, 18:08:29

VSCode Version: 1.96.0

biblicabeebli avatar Dec 16 '24 23:12 biblicabeebli

This repository is no longer maintained. The original author is MIA. Issues and PRs have been completely ignored by the owner for a few years.

I have forked the repo here: https://github.com/dnut/Rewrap

I'll be quick to respond to issues. But I'll be honest. It may take a long time for me to fix bugs. I'll be merging PRs quickly though, if someone else finds a fix.

dnut avatar Jan 23 '25 13:01 dnut

Oh sweet

biblicabeebli avatar Jan 23 '25 13:01 biblicabeebli

def get_resendable_uuids(now, pushable_participant_pks): """ Get the uuids of relevant archives. This includes a per-study timeout value for how """ frequently to resend, and a filter by last updated time. """

eqbalh263-blip avatar Jul 27 '25 07:07 eqbalh263-blip

def get_resendable_uuids(now, pushable_participant_pks): """ Get the uuids of relevant archives. This includes a per-study timeout value for how """ frequently to resend, and a filter by last updated time. """

eqbalh263-blip avatar Jul 27 '25 07:07 eqbalh263-blip