Typically, to use a language service, you request it with a service provider.
But, unfortunately, the C # language service in VS2010 does not provide a public and supported API for retrieving such source code information. There is a code model API , but it does not support method bodies at all. A future version of Visual Studio will provide features such as a public API.
So, I think you have options:
- analyze the source code yourself (for example, using cci ). These are mainly VS core partners such as Resharper and CodeRush.
- I also checked if DXCore from DevExpress (which is free) provides such an API.
source share