Skip to content

Conversation

@som-snytt
Copy link
Contributor

If f{}{} is candidate for rewrite, unpatch it.

We don't know exact spans, so just check endpoints to remove.

Fixes #21382

@som-snytt
Copy link
Contributor Author

Not a satisfying solution, but has the virtue of discretion (of being discrete).

It would be more natural to check lastToken against colonEOLPredecessors and turn off canRewrite. I expected to have to scan backward in text for previous token, and set a variable like possibleColonOffset to turn off the rewrite non-contextually.

If `f{}{}` is candidate for rewrite, unpatch it.

We don't know exact spans, so just check endpoints to remove.
@som-snytt som-snytt force-pushed the issue/21382-rewrite-braces branch from fd37567 to 32c0e10 Compare August 20, 2024 22:26
@som-snytt som-snytt closed this Sep 15, 2024
@bracevac
Copy link
Contributor

@som-snytt do you plan to work on this or should I take it from here?

@som-snytt
Copy link
Contributor Author

@bracevac I had no immediate plan. Feel free to either use it or lose it!

@som-snytt
Copy link
Contributor Author

superseded by #21982

@som-snytt som-snytt deleted the issue/21382-rewrite-braces branch November 19, 2024 16:58
@som-snytt som-snytt changed the title Undo patch of double-block apply [SUPERSEDED] Undo patch of double-block apply Nov 19, 2024
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.

-indent -rewrite can produce inparsable code for curried methods taking triple-quote arguments

2 participants