maca88 / AsyncGenerator

Generating async c# code using Roslyn
MIT License
47 stars 16 forks source link

Copying already async methods for new types #143

Closed maca88 closed 4 years ago

maca88 commented 4 years ago

When methods are generated in a new type, async methods should not be copied if not used. Example:

public class AlreadyAsync
{
  public void Read()
  {
    SimpleFile.Read();
  }

  public void Read2()
  {
  }

  public Task Read2Async()
  {
    return SimpleFile.ReadAsync();
  }

  public Task Read3Async()
  {
    return SimpleFile.ReadAsync();
  }
}

Expected: Only ReadAsync method should be generated. Actual: ReadAsync, Read2Async and Read3Async are generated.