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

The ktfmt plugin for IntelliJ IDEs isn't overriding cmd+opt+L #223

Closed
ColtonIdle opened this issue May 1, 2021 · 8 comments
Closed

The ktfmt plugin for IntelliJ IDEs isn't overriding cmd+opt+L #223

ColtonIdle opened this issue May 1, 2021 · 8 comments

Comments

@ColtonIdle
Copy link

ColtonIdle commented May 1, 2021

I've been trying out ktfmt today and I really like it, but the big selling point to me is the intellij plugin. If I enable the plugin and then press cmd + shift + l, the results are identical to the results without it. And the real kicker is that if I run the jar directly against my project the formatting is different. I'm convinced cmd + opt + L isn't actually overriding the Android Studio shortcut.

Is there any way to tell if the reformat was applied by ktfmt?

I'm using AS Canary 14

@ColtonIdle ColtonIdle changed the title The ktfmt plugin for IntelliJ IDEs isn't overriding cmd+shift+L The ktfmt plugin for IntelliJ IDEs isn't overriding cmd+opt+L May 2, 2021
@cgrushko
Copy link
Contributor

cgrushko commented May 2, 2021

First thing to check - is the plug-in enabled? Go to settings and search for ktfmt, then check the Enabled checkbox.
If there's no such Settings, it's probably due to AS running on JDK 8 while ktfmt requiring JDK 11. See #201

@ColtonIdle
Copy link
Author

Screen Shot 2021-05-02 at 8 57 07 AM

It's enabled. Is there any way to tell if cmd opt L is actually applied from the plugin rather than me just guessing?

@cgrushko
Copy link
Contributor

cgrushko commented May 2, 2021

This looks correct. IntelliJ has some logs (shows up in the right bottom corner), but I'm not an expert in plugins and how to debug them.

@ColtonIdle
Copy link
Author

@cgrushko thanks for the response. I don't see any logs regarding ktfmt so I guess I will keep this open to see if anyone else that maintains the plugin can chime in.

@ColtonIdle
Copy link
Author

It looks like the plugin is actually working correctly, but it's still tough to tell when it's actually ktfmt making the change. Closing for now.

@ColtonIdle
Copy link
Author

Reopening. Something seems off.

ktfmt_issue_1.mp4

@ColtonIdle ColtonIdle reopened this May 7, 2021
@cgrushko
Copy link
Contributor

cgrushko commented May 7, 2021

@ColtonIdle that looks like ktfmt failed to parse the file, or alternatively that it failed an internal assertion.
Can you try pasting the file onto https://facebookincubator.github.io/ktfmt/ , formatting, and seeing if it reports an error?

@ColtonIdle
Copy link
Author

ktfmt website does not fail seems to be due to another issue.

Closing in favor of #228

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

2 participants