Get all usages of a TypeDeclerationSyntax in Incremental Source Generator

63 Views Asked by At

I have a generic class and i need to access all generic usages of that class using incremental source generators.

My class is like:

public class User<T>
{
    public int Id { get; set; }
    public T Data { get; set; }
}

and in somewhere in code, i use it like:

User<bool> userWithBool = new();

and

User<SomeOtherClass> userWithSomeOtherClass = new();

I need to get that bool and SomeOtherClass. How can i do that? I can't find any info on google about this.

0

There are 0 best solutions below