Skip to content

Generated code makes it hard to navigate the call chain #458

Description

Simply put, when I see a call like this in an orchestration:

await context.CallMyActivityAsync(myActivityInput);

and I click into it in my IDE or try to follow that call, the generated method is not helpful, because I can't navigate to the actual activity class:

public static Task<string> CallMyActivityAsync(this TaskOrchestrationContext ctx, string input, TaskOptions? options = null)
{
    return ctx.CallActivityAsync<string>("MyActivity", input, options);
}

The generator could just as well produce output that enables navigation:

public static Task<string> CallMyActivityAsync(this TaskOrchestrationContext ctx, string input, TaskOptions? options = null)
{
    return ctx.CallActivityAsync<string>(typeof(MyActivity).GetTaskName(), input, options);
}

The GetTaskName extension method is currently internal, but it should be made public anyway.

Alternatively, the generator could render xml documentation with a link to the activity class:

/// <summary>
/// Calls the <see cref="MyNamespace.MyActivity" /> activity.
/// </summary>
public static Task<string> CallMyActivityAsync(this TaskOrchestrationContext ctx, string input, TaskOptions? options = null)
{
    return ctx.CallActivityAsync<string>("MyActivity", input, options);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions