Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string_processing: duplicates comments when reformatting a multi-line call with comments in the middle #3665

Open
yilei opened this issue Apr 27, 2023 · 1 comment
Labels
C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. F: strings Related to our handling of strings T: bug Something isn't working

Comments

@yilei
Copy link
Contributor

yilei commented Apr 27, 2023

Describe the bug

The following code

a = b.c(
    d,  # comment
    ("e")
)

is formatted to:

a = b.c(d, "e")  # comment  # comment

with the comment duplicated.

Only happens in preview style, and the parentheses in ("e") are needed to reproduce. So this is likely something in removing these parentheses.

See playground.

@yilei yilei added the T: bug Something isn't working label Apr 27, 2023
@hauntsaninja hauntsaninja added the C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. label Jul 10, 2023
@hauntsaninja hauntsaninja added the F: strings Related to our handling of strings label Sep 3, 2023
@hauntsaninja
Copy link
Collaborator

Looks like it only happens with the string_processing feature enabled

@JelleZijlstra JelleZijlstra changed the title Preview style duplicates comments when reformatting a multi-line call with comments in the middle string_processing: duplicates comments when reformatting a multi-line call with comments in the middle Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: preview style Issues with the preview and unstable style. Add the name of the responsible feature in the title. F: strings Related to our handling of strings T: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants