Skip to content

How do I find all classes that derive from specified class or interface efficiently in Incremental Generator? #71402

Answered by CyrusNajmabadi
MaxSavenkov asked this question in Q&A
Discussion options

You must be logged in to vote

What am I missing? Is there a way to do this efficiently,

There is no way to do this efficiently

or should I bite the bullet and just mark every class of interest with an attribute

Yes. Do this.

(maybe with an Analyzer that checks if a class derived from a marked class is not marked and adds a diagnostic, to avoid errors)?

Yes. Do this.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by MaxSavenkov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants