Skip to content

Instantly share code, notes, and snippets.

@drawers
Created June 12, 2021 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drawers/f88ec96ab13d958380a529d5782722c0 to your computer and use it in GitHub Desktop.
Save drawers/f88ec96ab13d958380a529d5782722c0 to your computer and use it in GitHub Desktop.
class IntSummableProcessor(
private val options: Map<String, String>,
private val codeGenerator: CodeGenerator,
private val logger: KSPLogger
) : SymbolProcessor {
private lateinit var intType: KSType
override fun process(resolver: Resolver): List<KSAnnotated> {
intType = resolver.builtIns.intType
val symbols = resolver.getSymbolsWithAnnotation(IntSummable::class.qualifiedName!!)
val unableToProcess = symbols.filterNot { it.validate() }
symbols.filter { it is KSClassDeclaration && it.validate() }
.forEach { it.accept(Visitor(), Unit) }
return unableToProcess.toList()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment