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

Idempotency check fails for comment in import list #1076

Open
Vlix opened this issue Nov 16, 2023 · 0 comments
Open

Idempotency check fails for comment in import list #1076

Vlix opened this issue Nov 16, 2023 · 0 comments
Labels
comments Issues related to comment placement idempotence Idempotence issues and solutions. style Nitpicking and things related to purely visual aspect for formatting.

Comments

@Vlix
Copy link

Vlix commented Nov 16, 2023

Describe the bug
If there is a comment in an (empty) identifier list of an import declaration, the comment floats out (which is already unwanted), but on top of that, in certain situations it's not even idempotent.

To Reproduce
The issue in a non-empty identifier list even happens here:

import Package1
import Package3 (
 hi,
 -- , import1
 test,
 )
import Package2

If you change the 2 into a 6, it remains idempotent, so in this case it's the reordering that causes the issue, I think.

The issue within an empty identifier list happens here:

import Package1
import Package3 (
 -- , import1
 )
import Package2

Even if you change the 2 into something >= 4, it's still not idempotent. Removing the 2 though, does work.

Expected behavior
The comment should not float out of the identifier list. And the change should be idempotent.

Environment

@amesgen amesgen added style Nitpicking and things related to purely visual aspect for formatting. comments Issues related to comment placement labels Nov 16, 2023
@amesgen amesgen added the idempotence Idempotence issues and solutions. label Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments Issues related to comment placement idempotence Idempotence issues and solutions. style Nitpicking and things related to purely visual aspect for formatting.
Projects
None yet
Development

No branches or pull requests

2 participants