Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions editor/doc/doc_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) {

if (signal_list.size()) {
for (const MethodInfo &mi : signal_list) {
if (mi.name.is_empty() || mi.name[0] == '_') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It dawned on me, how could a signal name possibly be empty?

Copy link
Member Author

@KoBeWi KoBeWi Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea, I copied it from methods

for (const MethodInfo &E : method_list) {
if (E.name.is_empty() || (E.name[0] == '_' && !(E.flags & METHOD_FLAG_VIRTUAL))) {

I think it's just safeguard, to avoid out of bounds crash on name[0].

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rrright, I guess it's faster than begins_with('_') (which probably doesn't even exist).

continue; // Hidden, don't count.
}

DocData::MethodDoc signal;
signal.name = mi.name;
for (const PropertyInfo &arginfo : mi.arguments) {
Expand Down
6 changes: 6 additions & 0 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,9 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
List<MethodInfo> signals;
scr->get_script_signal_list(&signals);
for (const MethodInfo &E : signals) {
if (E.name.begins_with("_")) {
continue;
}
int location = p_recursion_depth + _get_signal_location(scr, E.name);
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location);
r_result.insert(option.display, option);
Expand Down Expand Up @@ -1383,6 +1386,9 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
List<MethodInfo> signals;
ClassDB::get_signal_list(type, &signals);
for (const MethodInfo &E : signals) {
if (E.name.begins_with("_")) {
continue;
}
int location = p_recursion_depth + _get_signal_location(type, StringName(E.name));
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location);
r_result.insert(option.display, option);
Expand Down