jean
01/12/2024, 2:06 PMpackage com.my.package
fun testFunction() = ...
An in my ksp processor
val useCaseFunction = resolver.getFunctionDeclarationsByName("com.my.package.testFunction").toList()
if (useCaseFunction.isEmpty()) {
environment.logger.warn("No functions found with name $useCaseFunctionName")
} else {
environment.logger.warn("use case function: $useCaseFunction")
}
But I always get “No functions found with name com.jeantuffier.generator.getFact”. What am I suppose to use to make the resolver find the function?Jiaxiang
01/12/2024, 7:37 PMfun getFunctionDeclarationsByName(name: KSName, includeTopLevel: Boolean = false)
, there is an additional argument you need to set to be able to find top level functions, which is the function in your case.