Skip to content

Commit

Permalink
Ensure we only process classes and not interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann committed Nov 3, 2024
1 parent c8cb940 commit 7cdbf51
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.google.devtools.ksp.symbol.ClassKind
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.KSFunctionDeclaration
import com.google.devtools.ksp.symbol.KSPropertyDeclaration
import com.google.devtools.ksp.symbol.Modifier
import godot.annotation.GodotApiMember
import godot.annotation.Member
import godot.annotation.processor.Settings
Expand Down Expand Up @@ -95,7 +96,7 @@ internal fun KSClassDeclaration.mapToClazz(
functions = registeredFunctions,
signals = registeredSignals,
properties = registeredProperties,
isAbstract = isAbstract(),
isAbstract = this.modifiers.contains(Modifier.ABSTRACT),
isFqNameRegistrationEnabled = settings.isFqNameRegistrationEnabled,
classNamePrefix = settings.classPrefix,
symbolProcessorSource = this
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package godot.annotation.processor.visitor

import com.google.devtools.ksp.symbol.ClassKind
import com.google.devtools.ksp.symbol.KSClassDeclaration
import com.google.devtools.ksp.symbol.KSFile
import com.google.devtools.ksp.symbol.KSVisitorVoid
Expand Down Expand Up @@ -36,9 +37,11 @@ internal class RegistrationAnnotationVisitor(
if (declaration.hasCompilationErrors()) {
null
} else {
val clazz = declaration.mapToClazz(settings)
if (clazz is RegisteredClass) {
clazz
if (declaration.classKind == ClassKind.CLASS) {
val clazz = declaration.mapToClazz(settings)
if (clazz is RegisteredClass) {
clazz
} else null
} else null
}
}
Expand Down

0 comments on commit 7cdbf51

Please sign in to comment.