google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.83k stars 265 forks source link

[KSP2] Resolver.getDeclarationsFromPackage() couldn't find Java declarations #1952

Closed kuanyingchou closed 2 weeks ago

kuanyingchou commented 3 months ago

This started with 1.0.22 snapshot (1.0.21 was fine). When there is only Java sources in a package Resolver.getDeclarationsFromPackage() can't find the declarations in it. But after adding Kotlin source it works fine.

Repro: https://github.com/kuanyingchou/ksp/commit/d150c00eccc14b45422425d6a19d1a830116d915

kuanyingchou commented 3 weeks ago

It now works for Java sources for packages of one level, but doesn't seem to work for nested packages. Similar to the original issue adding Kotlin sources to the same package and it works.

Here's a repro: https://github.com/kuanyingchou/ksp/commit/d01db69c4fea254493c62edb22fd08d1715ac505