Skip to content

Commit

Permalink
added round brakcets for methods and signals autocompletion
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazy-Rabbit-2001 committed Nov 12, 2024
1 parent ec6a1c0 commit 50cbe28
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class,
option.insert_text += "(";
} else {
option.insert_text += "()";

}
break;
case GDScriptParser::ClassNode::Member::SIGNAL:
Expand Down Expand Up @@ -1196,6 +1197,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
for (const MethodInfo &E : signals) {
int location = p_recursion_depth + _get_signal_location(scr, E.name);
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location);
option.display += E.arguments.is_empty() ? "()" : "(...)";
r_result.insert(option.display, option);
}
}
Expand All @@ -1219,8 +1221,10 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
if (E.arguments.size()) {
option.insert_text += "(";
option.display += "()";
} else {
option.insert_text += "()";
option.display += "(...)";
}
r_result.insert(option.display, option);
}
Expand Down Expand Up @@ -1285,6 +1289,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
for (const MethodInfo &E : signals) {
int location = p_recursion_depth + _get_signal_location(type, StringName(E.name));
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location);
option.display += E.arguments.is_empty() ? "()" : "(...)";
r_result.insert(option.display, option);
}
}
Expand All @@ -1305,8 +1310,10 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
if (E.arguments.size()) {
option.insert_text += "(";
option.display += "()";
} else {
option.insert_text += "()";
option.display += "(...)";
}
r_result.insert(option.display, option);
}
Expand Down Expand Up @@ -1376,8 +1383,10 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
if (E.arguments.size()) {
option.insert_text += "(";
option.display += "()";
} else {
option.insert_text += "()";
option.display += "(...)";
}
r_result.insert(option.display, option);
}
Expand Down

0 comments on commit 50cbe28

Please sign in to comment.