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

GenerateAutomaticInterface attribute #29

Open
konrad-gora opened this issue Feb 9, 2024 · 4 comments
Open

GenerateAutomaticInterface attribute #29

konrad-gora opened this issue Feb 9, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@konrad-gora
Copy link

to use this package we need to create the GenerateAutomaticInterface attribute manually.
Could this attribute be generated, like interfaces?

This package https://github.com/daver32/InterfaceGenerator (inspired by yours) generates the attribute.

@ChristianSauer
Copy link
Collaborator

Interesting Idea, I will look into it.

@ChristianSauer ChristianSauer added the enhancement New feature or request label Feb 12, 2024
@Hau-Hau
Copy link

Hau-Hau commented Feb 26, 2024

I believe that attributes should be provided in separate nuget package to avoid problems with InternalsVisibleTo.
Please take a look on that: https://andrewlock.net/creating-a-source-generator-part-7-solving-the-source-generator-marker-attribute-problem-part1/

@anotherthomas
Copy link

anotherthomas commented Mar 21, 2024

The RegisterPostInitializationOutput option is neat, but as @Hau-Hau wrote can break things. Requiring another dependency just for that gets you into the "which one do I have to reference for the thing to work"...
The "conditionally generate, depending on user settings, and have another package for breaking cases" is somewhat complex for a pretty trivial marker interface.
Just my 2ct.

@konrad-gora
Copy link
Author

IMO just adding in a description of the additional package that contains only the attribute and the "main" package should be referenced would be enough.
Also, additional features could be considered that need attribute to be extended. Adding more properties to the attribute would be easier than asking users to do it themselves. (like InterfaceName or AccessModifier)
There could be another attribute to mark methods/properties that we don't want to add to the interface.

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

4 participants