Colton Idle

    Colton Idle

    9 months ago
    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. 😭
    Javier

    Javier

    9 months ago
    I am using ktfmt + compose daily with no issues
    with kotlinlang style tho
    Havent tried rest
    Colton Idle

    Colton Idle

    9 months ago
    @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?
    Javier

    Javier

    9 months ago
    Artic Fox mainly
    beta and canary a few
    Colton Idle

    Colton Idle

    9 months ago
    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
    Javier

    Javier

    9 months ago
    Why you can't use AF?
    Colton Idle

    Colton Idle

    9 months ago
    We're using some newer features of AGP that are pinning us to agp 7.2.0 alpha
    @Javier I updated https://github.com/facebookincubator/ktfmt/issues/249 with a comment + video showing a brand new compose project on latest arctic fox android studio. I have three laptops. all of them are exhibiting the same issue (mac OS). 1 intel, 2 m1 chip laptops. Is there anyway I can help the ktfmt project in debugging this? As you can see it fails on the most basic reformats in compose code.
    Javier

    Javier

    9 months ago
    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.
    Colton Idle

    Colton Idle

    9 months ago
    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?
    Javier

    Javier

    9 months ago
    compose with autocomplete some times added a huge package which starts with root, it is fixed in new AS versions
    Colton Idle

    Colton Idle

    9 months ago
    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. 😭
    Javier

    Javier

    9 months ago
    That settings doesn't exist, but it is a good feature request
    Colton Idle

    Colton Idle

    9 months ago
    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.
    Javier

    Javier

    9 months ago
    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)
    Colton Idle

    Colton Idle

    9 months ago
    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?
    Javier

    Javier

    9 months ago
    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
    Colton Idle

    Colton Idle

    9 months ago
    cmd + alt + L fails too
    Javier

    Javier

    9 months ago
    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
    Colton Idle

    Colton Idle

    9 months ago
    yep. It wasn't always like this. at some point ktfmt plugin (or AS) had an update and broke things.
    Javier

    Javier

    9 months ago
    but ktfmt probably is the latest one
    Colton Idle

    Colton Idle

    9 months ago
    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
    Javier

    Javier

    9 months ago
    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?
    Colton Idle

    Colton Idle

    8 months ago
    Just reporting back that it also happens with kotlinlang selected