Answer the question
In order to leave comments, you need to log in
How to write a Visual Studio extension for code generation?
How to write a Visual Studio extension so that a list of its methods is formed for a class in its summary.
If the project code is valid, how can the extension get the list of methods of the current edited class?
For example, there is a class:
public class Test : List<string>
{
public new void Add(string name)
{
base.Add(name);
}
public new void Remove(string name)
{
base.Remove(name);
}
public void Write()
{
foreach (var item in this)
Console.WriteLine(item);
}
}
/// <summary>
/// void Add(string name)
/// void Remove(string name)
/// void Write()
/// </summary>
public class Test : List<string>
{
Answer the question
In order to leave comments, you need to log in
If the option is suitable, add the partial and summary classes in a separate generated file, then I recommend not to bother with the extension, but use the Text Template Transformation Toolkit (T4) to generate
https://habr.com/ru/post/64895/
https:/ /docs.microsoft.com/en-us/visualstudio/mode...
To get a list of class methods, use reflection
https://metanit.com/sharp/tutorial/14.1.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question