Javier
11/18/2025, 3:20 PMModule Module <CommonOne> doesn't contain package <http://com.foo.dev.app|com.foo.dev.app>
It is throwed inside this function:
override fun getPackage(fqName: FqName): PackageViewDescriptor {
val symbolProvider = session.symbolProvider
if (symbolProvider.hasPackage(fqName)) {
return FirPackageViewDescriptor(fqName, this)
}
error("Module $moduleData doesn't contain package $fqName")
}
The test file is
// MODULE: CommonOne
// file: CommonOneFooDao.kt
package com.foo.common.one
import androidx.room.Dao
@Dao
interface CommonOneFooDao {
fun foo()
}
// MODULE: FeatureOne(CommonOne)
// file: FeatureOneFooDao.kt
package com.foo.feature.one
import androidx.room.Dao
@Dao
interface FeatureOneFooDao {
fun foo()
}
// MODULE: DevApp(FeatureOne, CommonOne)
// file: main.kt
package com.foo.dev.app.feature.one
fun main() {
}Javier
11/18/2025, 3:22 PMcom.foo.dev.app, but I don't know why it is limiting to me to only work on those packages.
On the other hand, is there a way to skip a module in the test file to be compiled by my plugin?Javier
11/18/2025, 3:26 PM// IGNORE_FIR
// IGNORE_BACKEND: ANYJavier
11/18/2025, 3:30 PMIGNORE_BACKEND cannot be used per module/file, it is globalbnorm
11/18/2025, 4:17 PMOn the other hand, is there a way to skip a module in the test file to be compiled by my plugin?You can create a custom directive that skips registering your plugin when applied to a module. So in the
EnvironmentConfigurator where your extensions are registered, you can skip if module.directives contains this directive.Javier
11/18/2025, 5:34 PMJavier
11/18/2025, 5:35 PM// excludedJavier
11/19/2025, 8:40 AM// file: … I change the packages to include the one I am getting in the error, the test works.bnorm
11/19/2025, 12:39 PMhasPackage function from your FirDeclarationgenerationExtension. If the extension says it has the package but never actually generates anything in that package, you might get this exception. https://github.com/Kotlin/compiler-plugin-template/blob/master/compiler-plugin/src[…]ins/kotlin/compiler/plugin/template/fir/SimpleClassGenerator.kt That's my guess right now at least, haven't had time to dig fully into this yet.Javier
11/19/2025, 12:40 PMSimpleClassGenerator to create the mine one, which is not including that override 🤔Javier
11/19/2025, 4:29 PM