Skip to content

Ability to add an attribute to roots. #65

Description

@cNoNim

In #63 assumes that if a composition has the [Module] attribute, then the [Provides] attribute is generated for its roots.

But controlling which attributes are added to roots would be ideal, similar to controlling modifiers via RootKinds.
I'm not sure which API is exactly realizable in terms of source generator capabilities.

Maybe something like:

	DI.Setup()
	  .Root<IService>(
		   "Service",
		   attributes:
		   [
			   new ProvidesAttribute(),
			   new MethodImplAttribute(MethodImplOptions.AggressiveInlining)
		   ]);

Note: Another RootKinds.Provides for the Module API may be a better choice.
This API will be used a lot.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions