fix: Fix (some) parts of custom block rendering.
This commit is contained in:
@@ -25,7 +25,7 @@ class SubscribeAnnotationProcessor(
|
||||
override fun finish() {
|
||||
subscriptions.sort()
|
||||
if (subscriptions.isEmpty()) return
|
||||
val subscriptionSet = subscriptions.mapTo(mutableSetOf()) { it.parent.containingFile!! }
|
||||
val subscriptionSet = subscriptions.mapTo(mutableSetOf()) { it.cf }
|
||||
val dependencies = Dependencies(
|
||||
aggregating = true,
|
||||
*subscriptionSet.toTypedArray())
|
||||
@@ -38,7 +38,7 @@ class SubscribeAnnotationProcessor(
|
||||
appendLine("// This file is @generated by SubscribeAnnotationProcessor")
|
||||
appendLine("// Do not edit")
|
||||
for (file in subscriptionSet) {
|
||||
appendLine("// Dependency: ${file.filePath}")
|
||||
appendLine("// Dependency: ${"TODO"?:file.filePath}")
|
||||
}
|
||||
appendLine("package moe.nea.firmament.annotations.generated.$sourceSetName")
|
||||
appendLine()
|
||||
@@ -48,7 +48,7 @@ class SubscribeAnnotationProcessor(
|
||||
appendLine("class $generatedFileName : SubscriptionList {")
|
||||
appendLine(" override fun provideSubscriptions(addSubscription: (Subscription<*>) -> Unit) {")
|
||||
for (subscription in subscriptions) {
|
||||
val owner = subscription.parent.qualifiedName!!.asString()
|
||||
val owner = subscription.pQName.asString()
|
||||
val method = subscription.child.simpleName.asString()
|
||||
val type = subscription.type.declaration.qualifiedName!!.asString()
|
||||
appendLine(" addSubscription(Subscription<$type>(")
|
||||
@@ -75,13 +75,15 @@ class SubscribeAnnotationProcessor(
|
||||
val child: KSFunctionDeclaration,
|
||||
val type: KSType,
|
||||
) : Comparable<Subscription> {
|
||||
val cf = parent.containingFile!!
|
||||
val pQName = parent.qualifiedName!!
|
||||
val tName = type.declaration.qualifiedName!!
|
||||
override fun compareTo(other: Subscription): Int {
|
||||
var compare = parent.qualifiedName!!.asString().compareTo(other.parent.qualifiedName!!.asString())
|
||||
var compare = pQName.asString().compareTo(other.pQName.asString())
|
||||
if (compare != 0) return compare
|
||||
compare = other.child.simpleName.asString().compareTo(child.simpleName.asString())
|
||||
if (compare != 0) return compare
|
||||
compare = other.type.declaration.qualifiedName!!.asString()
|
||||
.compareTo(type.declaration.qualifiedName!!.asString())
|
||||
compare = other.tName.asString().compareTo(tName.asString())
|
||||
if (compare != 0) return compare
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user