Add C# Editor Documentation #40631
Add C# Editor Documentation #40631
Conversation
// C# | ||
bool first_is_underscore = p_name[0] == '_'; | ||
String result = p_name.capitalize(); | ||
return (first_is_underscore ? "_" : "") + result.replace(" ", ""); |
aaronfranke
Jul 23, 2020
•
Member
Maybe we should make a method on String to do this? I think it would be more efficient, we could make a method that doesn't involve string splitting and re-concatenation - we can simply capitalize every letter after _
(and at the beginning) and then afterwards do a find/replace "_"
with ""
(except keep one at the beginning if there was one).
Maybe we should make a method on String to do this? I think it would be more efficient, we could make a method that doesn't involve string splitting and re-concatenation - we can simply capitalize every letter after _
(and at the beginning) and then afterwards do a find/replace "_"
with ""
(except keep one at the beginning if there was one).
Calinou
Jul 24, 2020
•
Member
I'd try to benchmark that code to see if it's an actual bottleneck first (even using good old OS::get_singleton()->get_ticks_usec()
). Adding more code to the String class should be done cautiously.
I'd try to benchmark that code to see if it's an actual bottleneck first (even using good old OS::get_singleton()->get_ticks_usec()
). Adding more code to the String class should be done cautiously.
HaSa1002
Jul 24, 2020
Author
Contributor
Will do, but this code is not executed in a performance critical part of the engine. I can test wheter or not a iteration above the whole string is faster
Will do, but this code is not executed in a performance critical part of the engine. I can test wheter or not a iteration above the whole string is faster
Please add C# related macro checking, this features should not exist in the engine without C# support. |
|
I'm not necessarily against this, but it's not the ideal way:
IMO, the best would be to generate these from the information we get from the API assemblies and their generated |
Also -not a blocker either as this can be done incrementally in future PRs- but it would be better if this wasn't hard-coded in |
The user can select, how the reference should be rendered in the editor settings.

text_editor/help/class_reference_language: GDScript
text_editor/help/class_reference_language: C#

The conversion to PascalCase is done automatically.
This is moved out of #40613