Let me share an issue. When using KSP2, it seems t...
# ksp
t
Let me share an issue. When using KSP2, it seems that the
SymbolProcessor
does not recognize annotations that contain backticks in the package name. For example, consider the following annotation:
Copy code
@`org.komapper.annotation`.KomapperEntity
data class Employee(val id: Int)
The ``org.komapper.annotation`.KomapperEntity` annotation is recognized by the
SymbolProcessor
in version 2.0.21-1.0.25, but it is not recognized in version 2.0.21-1.0.26.
t
Hi @Toshihiro Nakamura, thanks for sharing the issue! Would you mind elaborating on the definition of recognize?
Resolver.getSymbolsWithAnnotation
seems working fine: https://github.com/google/ksp/compare/main...ting-yuan:ksp:backticks
t
Hi, @Ting-Yuan Huang thank you for the response! In my environment,
Resolver.getSymbolsWithAnnotation
does not return the correct values. In other words, it returns a sequence that does not contain the expected symbols. Let me know if you need a minimal reproducible project; I’ll try to create one.
t
A reproducible project would be great, since I haven't been able to reproduce it. Thanks!
👍 1
t
I’ve created a reproducible project. Please take a look: https://github.com/nakamura-to/ksp-backticks
🙏 1
t
Quoting around dots may be invalid in Kotlin/JVM according to the language spec. See the section of Identifier. This may explain why it only reproduces when the annotation is defined in a library / compiled class. I open an issue here for discussion.
👍 1
t
Thank you for the information. I realized that, in my case, I should simply use `@`com`.
example
.Anno` instead of `@`com.example`.Anno`.