Skip to content

Remove looking for body statement #95

Description

@dex3r

In a previous PR, #94, a new way to create body was added: to copy the code defined in UseProvidedBody method to the target body.

I like how that works, but I don't like how that is implemented. In DelegateBodySyntaxExtractor, the code looks for memberAccess.Name.Identifier.Text == "UseProvidedBody" which is not very clean.

In BodyGenerationData record, the delegate defined in UseProvidedBody is already stored. Is that not enough to copy the source code? Maybe UseProvidedBody instead of taking Action/Func delegate, should take some "Expression" parameter, or something, so it can capture the exact code, which would remove the need to look for "UseProvidedBody" string?

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions