Waldemar Kornewald
05/05/2025, 2:17 PMdmitriy.novozhilov
05/05/2025, 2:29 PMWouldn't a FIR checker plugin minimize the CI run times because it runs directly with the compilation while AA requires an additional parse/analysis step?That's correct, the plugin is the fastest option.
Does AA just provide a more high-level / convenient API than FIR or would the checks have similar complexity in both?The API of AA and FIR are quite similar. Keep in mind that AA symbols is just a wrapper over the FIR declarations. But again, with AA you cannot write body checkers in vacuum.
As a more extreme example, wouldn't a detekt-like FIR (maybe +IR) compiler plugin provide a better user experience since all checks would be visible on-the-fly in the IDE? Or would such a plugin cause too much overhead because it has maybe 200 checks that run all the time while typing?It depends on how fast/slow these checks are. The compiler itself has about 200-300 hundred checkers, and some of them do quite non-trivial job, but the IDE experience is acceptable. But if you go with IDE integration, then the plugin compatibility is the issue. Compiler version used by IDE for analysis never matches none of released compilers, and you most likely will experience compatibility problems all the time, unless you compile your plugin specially for the each IDE version you want to support (check messages in the channel, it's quite a hot topic).
dmitriy.novozhilov
05/05/2025, 2:30 PMWaldemar Kornewald
05/05/2025, 3:57 PMAFAIR standalone analysis API doesn't provide access to bodies, so detekt-like inspections are impossible to implement with it. You could write an IDE plugin and use AA to get the resolve information in the same way as Kotlin IDE plugin does for inspections. The same plugin could be run on CI using Qodana.Isn't detekt currently migrating to use the new analysis API? Does that mean they might not be able to implement all their inspections? Or is that not an actual problem if they integrate the compiler like KSP2 does?
dmitriy.novozhilov
05/05/2025, 4:07 PM