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

IDEA plugin v1.1.0.51 with Kotlinlang formats incorrectly #489

Closed
akheron opened this issue Jun 26, 2024 · 3 comments
Closed

IDEA plugin v1.1.0.51 with Kotlinlang formats incorrectly #489

akheron opened this issue Jun 26, 2024 · 3 comments

Comments

@akheron
Copy link

akheron commented Jun 26, 2024

After upgrading the ktfmt IDEA plugin to 1.1.0.51, configured to use the Kotlinlang style, the Reformat code action behaves differently than when running ktfmt v0.51 directly. Specifically, it moves the closing parenthesis of multiline function calls to the previous line:

Expected:

foo(
    1,
    2
)

Actual:

foo(
    1,
    2)

Is this expected, or is there a bug in the IDEA plugin?

@asapha
Copy link

asapha commented Jun 26, 2024

Both the plugin and the cli have the new (undesired) behavior on my end.
Are you sure you're running 0.51?

brew info ktfmt

==> ktfmt: stable 0.51 (bottled)
Kotlin code formatter
https://facebook.github.io/ktfmt/
Installed

Also, see #482.

@YarnSphere
Copy link

YarnSphere commented Jun 26, 2024

I can't fully reproduce what you describe, @akheron. I get your "Actual" output both when running ktfmt v0.51 directly (well, in my case via the Spotless Gradle plugin) and via the IDEA plugin, so at least both outputs are consistent.

However, I would like to reiterate your question to the ktfmt developers, is this new output expected? I see no mentions of the change in the changelog, and it seems to go against Kotlinlang conventions.

@akheron
Copy link
Author

akheron commented Jun 26, 2024

I'm running ktfmt via the Gradle plugin com.ncorti.ktfmt.gradle, and it indeed seems to still use an older version of ktfmt. Sorry for the confusion! I opened a new issue #490 about the formatting change.

@akheron akheron closed this as completed Jun 26, 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

No branches or pull requests

3 participants