Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Specify 'this' keyword on introduced parameters #339

Open
WhitWaldo opened this issue Jul 22, 2024 · 1 comment
Open

Feature: Specify 'this' keyword on introduced parameters #339

WhitWaldo opened this issue Jul 22, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@WhitWaldo
Copy link

I would like to introduce a static extension method to a type and am able to create the method and mark it as static without issue. But when introducing the parameters to the introduced method, there isn't an option to indicate that the 'this' keyword should be inserted, leaving one unable to actually create an extension method.

        var serviceCollectionType = (INamedType)TypeFactory.GetType(typeof(IServiceCollection));
        
        builderType.IntroduceMethod(nameof(BuildMethodTemplate),
            IntroductionScope.Static,
            buildMethod: b =>
            {
                b.Name = "RegisterAllEntities";
                b.Accessibility = Accessibility.Public;
                //b.AddParameter("serviceCollection", serviceCollectionType); //Need some way to specify 'this'
            });

I would like to request such a capability. Thank you for the consideration!

@gfraiteur
Copy link
Member

Thank you for spotting this gap.

@gfraiteur gfraiteur added the enhancement New feature or request label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants