In Visual Studio, I can right-click a class or method and choose \"Find usages\". That gives me a list of places in my solution where that piece of code is used. How can I d
To be honest, I never did that before, as I never needed kind of thing.
For access to kind of information you need to have access to Token Tree of the compiler, constructed for semantic analysis.
That kind of information, for sure you can have access from Roslyn (API for C# compiler). Where you can push into the API function a C# text, run a compiler over it and recover Tokens tree.
The Roslyn Project Overview
Hope this helps.