Skip to content

Bug: WaitAsync drops the entire invocation chain instead of just renaming the original call #121

Description

@michelebastione

As per the title, consider the following example:

public partial class Class
{
    private XmlReader reader;

    [CreateSyncVersion]
    public async Task MethodAsync(CancellationToken ct = default)
    {
        _ = await reader.ReadAsync().WaitAsync(ct);
    }
}

The expected generation is:

public partial class Class
{
    public void Method()
    {
        _ = reader.Read();
    }
}

What happens instead is that the whole invocation gets deleted:

public partial class Class
{
    public void Method()
    {
    }
}

I will shortly open a PR that tries to address this issue as a well as #119, which appears to be a closely related problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions