https://kotlinlang.org logo
#ktfmt
Title
# ktfmt
c

Colton Idle

12/15/2021, 5:10 AM
If anyone has any free time, do you mind seeing if you can reproduce this bug? https://github.com/facebookincubator/ktfmt/issues/249 It's been going on for months and it drives me absolutely insane. Calling reformat code with the ktfmt plugin literally breaks my code. 😭
2
j

Javier

12/16/2021, 7:13 PM
I am using ktfmt + compose daily with no issues
with kotlinlang style tho
Havent tried rest
c

Colton Idle

12/16/2021, 8:23 PM
@Javier thank you so much for responding. I will set my style to kotlinlang to see if it fixes it. What version of AS are you using? I'm on chipmunk canaries. I wonder if maybe that's the issue?
j

Javier

12/16/2021, 8:35 PM
Artic Fox mainly
beta and canary a few
c

Colton Idle

12/16/2021, 9:05 PM
hm. I can't use AF, but maybe I'll "downgrade" to bumblebee beta and see if it has the same issue. I did switch to kotlinlang and seemed to have the same issue. /shruggie
j

Javier

12/16/2021, 9:58 PM
Why you can't use AF?
c

Colton Idle

12/16/2021, 10:38 PM
We're using some newer features of AGP that are pinning us to agp 7.2.0 alpha
j

Javier

12/18/2021, 9:09 AM
Is it only happening when it autocompletes? I don't use it a lot with Compose because it was broken (root issue and so on caused by compose). Maybe disabling that ktfmt applies when autocompletes solves the problem.
c

Colton Idle

12/18/2021, 9:51 AM
Auto complete has always worked for me. How can I disable ktfmt applying on auto-complete?
also, what do you mean by "(root issue and so on caused by compose)" Compose has an issue with formatting code?
j

Javier

12/18/2021, 10:15 AM
compose with autocomplete some times added a huge package which starts with root, it is fixed in new AS versions
c

Colton Idle

12/18/2021, 10:16 AM
hm. I get the same issue in canary. Do you know where the setting is to disable reformat code on autocomplete? I can't find it.
I don't understand how I'm the only one that can reproduce. 😭
j

Javier

12/18/2021, 11:13 AM
That settings doesn't exist, but it is a good feature request
c

Colton Idle

12/18/2021, 6:44 PM
But this issue isn't happening to you? Are you sure you use the ktfmt plugin? I've tried stable, beta and canary AS and all of them have this issue.
j

Javier

12/18/2021, 7:16 PM
yes I use it. But I don't autocomplete a lot, first because it is slower than my writing speed, and second because it is bugged without ktfmt (root issue), so I am not using it in compose files a lot. Even imports are not being added some times by the IDE and I have to copy and paste them (not a ktfmt issue)
c

Colton Idle

12/18/2021, 9:08 PM
Gotcha. Okay. Thanks for following up. Any idea what logs or anything I can do to help debug the issue? Should I file an issue with IJ at this point?
j

Javier

12/18/2021, 9:14 PM
About the root bug, it is reported. About the ktfmt one, probably only wait until ktfmt maintainers can take a look to it
with cmd alt L it is failing too?
or only when autocompleting
c

Colton Idle

12/18/2021, 9:14 PM
cmd + alt + L fails too
j

Javier

12/18/2021, 9:15 PM
that is really weird
I saw that issue zero times with that command
with kotlinlang, not sure if latest kftmt tho
monday I can check the version
c

Colton Idle

12/18/2021, 9:15 PM
yep. It wasn't always like this. at some point ktfmt plugin (or AS) had an update and broke things.
j

Javier

12/18/2021, 9:16 PM
but ktfmt probably is the latest one
c

Colton Idle

12/18/2021, 9:16 PM
I might try to start backtracking and seeing if I can figure out when it started happening.
thanks for checking though Javier. I only have one other team member, and they have reported the same issue. so it kind of sucks. dont know what to do. lol
j

Javier

12/18/2021, 9:16 PM
not sure how to get logs from intellij plugin (without cloning the repo)
try forking ktfmt and open the project in the IDE "created" for using the plugin so you can debug it and see all exceptions
but it looks like it is not crashing
@Carmi Grushko, can you take a look to the reproducer created by @Colton Idle?
🙏 1
c

Colton Idle

01/03/2022, 12:50 AM
Just reporting back that it also happens with kotlinlang selected
5 Views