Open DavidDudson opened 6 years ago
Semantic discovery has one more advantage: generators can access the fully qualified names in the code. I think for now we can start with syntactic discovery just to get off the ground, I'm happy to help setup semantic discovery later down the road. The changes should be
app-gen
projectclassDirectory
to scalagenSemanticdbIndex
to generators (does not exist yet, we should move the one in scalafix to scalameta)I propose we push for at a bare minimum FQN discovery for 0.1, with the potential for semantic-db etc. being added to generator contexts for 0.2
Syntactic
Search for an annotation with the appropriate name. Not fully qualified.
Pros: Extremely fast, no overhead. Cons: Will break if two annotations with the same name exist.
Semantic
Searches for an annotation with the correct fully qualified name.
Pros: Safe Cons: May have to build a semantic database of the source file
I believe that we should stick with syntactic discovery for now. If enough users wish for semantic discovery we should add it via a flag, so that those who don't need semantic discovery, do not have to take the performance hit.