line/lich

IDE cannot access generated sources from lich savedstate compiler

ganadist opened this issue · 1 comments

Related issue : google/ksp#746

When using ksp and savedstate compiler, IDE(such as Android Studio) cannot resolve symbols from generated sources as default.

image

In this case, many IDE feature will be malfunction such as Code Formatting

In other libraries cases such as Room which are providing annotation processors, library provides Builder API which are wrapping generated sources and allow to access.

ex : https://developer.android.com/training/data-storage/room#usage

Similar to Room, is it possible to avoid referencing the generated code directly?

As you may have already noticed, this is a problem that should be solved on the KSP Gradle Plugin (or Android Gradle Plugin?) side.

is it possible to avoid referencing the generated code directly?

There is no plan to introduce such a workaround as it would break the existing code.

You can manually add the generated codes as "Generated Sources Root" as follows:
screenshot