Skip to content

Ability to add an attribute to roots. #65

@cNoNim

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.

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