-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
C#: Add [ScriptMethodExclude]
. An attribute that excluding method generation from source generators
#90687
base: master
Are you sure you want to change the base?
Conversation
…eneration from source generators.
[ScriptMethodExcludeAttribute]
. An attribute that excluding method generation from source generators[ScriptMethodExclude]
. An attribute that excluding method generation from source generators
[ScriptMethodExclude]
. An attribute that excluding method generation from source generators[ScriptMethodExclude]
. An attribute that excluding method generation from source generators
Hello, and thank you for the contribution 😀 |
I apologize for taking so long to get back to you. Here are my reasons for submitting this PR:
|
No need to apologize, there's no rush at all. I don't think impact on performance is in consideration here. The amount of code we'd have to generate for this to actually matter would be massive. I do agree that automatically exposing non-public members to the Can I ask if you have a concrete example as to what prompted you to open this PR? |
I actually have a use case for this attribute, This is what that compiler-breaking method looks like: Compile my included C# wrapper file will sometimes cause the following compiler issue: I wish we could have this attribute that I can add for each wrapper method, to at least make it compile (as these methods shouldn't be called by others anyway). |
I think this is actually a good addition to the API. Arguably, I'd make it cc @raulsntos |
The .NET team has discussed this PR and agree that this is a good addition, but as suggested by @paulloz we'd like to extend the attribute to work for properties as well. We also bikeshed a bit about the name:
In the end, we think both We also intend to merge this PR for 4.4, so I'm adjusting the milestone accordingly. Keep in mind this is not a guarantee that it will be merged for 4.4, and may still be pushed to a later milestone if we can't finish it in time. |
I rather like |
C#: Add
[ScriptMethodExclude]
.An attribute that excluding method generation from source generators.