How to create a VS2010 extension using language services

Creating extensions has become much easier with Vs2010, but it seems this is not the case for everything ...

My goal: I want to make method calls and use the properties of the STATIC ITALIC classes. (Same as Eclipse and Java)

I think I need to talk to the C # Language Service for this information, but searching for "Language Service" only gives results, like CREATE, and not how to use one of the existing ones ...

To get this question a little more general: how do I get information about the properties of the code (static / visibility, etc.) for using it in VSX?

+4
source share
1 answer

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.
+3
source

Source: https://habr.com/ru/post/1307342/


All Articles