Visual Studio Add-in for C # Development

I want to write my first Visual Studio 2010 add-in. My goal is to create an add-in that will help you automatically generate code for things like:

  • implement superclass constructors
  • create delegation methods for an object
  • and etc.

Of course, in order to know what needs to be generated, my add-in must have an idea of ​​the code file that the user is about to insert the generated code. (classes, base classes ...)

My first thought was to use C # -parser . Is this the right way? Is there any part of the .NET-Framework, COM-Object, or any other "inline"?

Thanks in advance.

PS: It is noticed that the CSharpCodeProviderclass method Parse()has not yet been implemented by Microsoft. -_-

+3
source share
2 answers

You can start by looking at EnvDTE , which helps you look at project files and code trees that Visual Studio has already analyzed and analyzed, as well as their modifications. EnvDTE is quite simple and error prone (I used it several times). Finding good in-depth lessons is also difficult.

, , , . ReSharper, , ( ). , API EnvDTE ( ), / #.

+2

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


All Articles