-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Disable signal callback generation in C# #87952
Disable signal callback generation in C# #87952
Conversation
bd1dab1
to
4f95e07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM code wise
4f95e07
to
551c1c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we find a better workaround for this (such as displaying the code you should copy in a read-only TextEdit), this is probably for the better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel a bit hesitant about adding new API to ScriptLanguage. I don't know if there are Script languages other than C# that would make use of this, adding this just for C# knowing that C# will eventually move away from the ScriptLanguage API feels wrong.
But if the area maintainers are fine with this, then I do think this is an improvement over the current state for C#.
I had a similar feeling. We could simply always return an empty string and not display anything to the user. It'd be a bit worse UX, but still better than the current state, IMHO. In that case, I'd still modify the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine to add this method. It does feel very specific, but find_function
and make_function
do too and they're already part of the API. Having a boolean check to control the user of those two methods doesn't seem too far fetched.
551c1c0
to
9fa2355
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks!
Thanks! |
I have a question about this: is this breaks custom signal registration by code as introduced on docs? |
Hello! No, this only blocks the editor to write the empty method in your |
A while ago, we talked about disabling the signal callback generation altogether for C# until we have a better implementation. Reasons are, it currently generates the method outside the class (creates compilation error, obviously), and the behaviour is weirdly inconsistent depending on how you have external editors configured.
To prevent confusion like "the dialog didn't do the thing", I added a small message in the connection window, depending on the language of the script. Not sure if this is wanted, let me know (also, the message itself probably kinda sucks, feel free to suggest something better).
Bugsquad edit: