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

New line after imports #141

Open
ov7a opened this issue Mar 5, 2025 · 0 comments
Open

New line after imports #141

ov7a opened this issue Mar 5, 2025 · 0 comments

Comments

@ov7a
Copy link
Contributor

ov7a commented Mar 5, 2025

Apparently, this is a valid Kotlin code:

package foo.bar.goo import foo import foo.bar import foo as bar import foo.bar as bar import foo.*import foo.*

This is the output from this test case in CorpusParseAndWriteWithExtrasTest:

package foo.bar.goo

import foo
import foo.bar
import foo as bar
import foo.bar as bar
import foo.*
import foo. *

However, it is quite counter-intuitive and not very user-friendly to have this kind of output.

It would be nice to have a convenient way to write imports in a human-readable way.
I can image two possible ways to the solution:
a) patch the Writer to always produce a new line after import
b) provide a convenient helper to create a new import/wrap old imports with new lines.

Let me know what you think. I can open a PR to fix that.

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

No branches or pull requests

1 participant