summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_editor.cpp
diff options
context:
space:
mode:
authorSpartan322 <Megacake1234@gmail.com>2024-11-26 12:56:19 -0500
committerSpartan322 <Megacake1234@gmail.com>2024-11-26 12:56:19 -0500
commite58e18261ea7ed3978146ef8d77a900be2601be3 (patch)
tree79c2a4c34f2d888ff962d76edf474c518d1abdea /modules/gdscript/gdscript_editor.cpp
parentc5b1645e60a59c0292c04bece3fdb0715a61afea (diff)
parentd09d82d433b03bb3773fd2a8cc8d6ccc2f8739ce (diff)
downloadredot-engine-e58e18261ea7ed3978146ef8d77a900be2601be3.tar.gz
Merge commit godotengine/godot@d09d82d433b03bb3773fd2a8cc8d6ccc2f8739ce
Diffstat (limited to 'modules/gdscript/gdscript_editor.cpp')
-rw-r--r--modules/gdscript/gdscript_editor.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index c3f091a2a3..1011fb6a86 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -1141,10 +1141,12 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class,
continue;
}
option = ScriptLanguage::CodeCompletionOption(member.function->identifier->name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
- if (member.function->parameters.size() > 0) {
+ if (member.function->parameters.size() > 0 || (member.function->info.flags & METHOD_FLAG_VARARG)) {
option.insert_text += "(";
+ option.display += U"(\u2026)";
} else {
option.insert_text += "()";
+ option.display += "()";
}
break;
case GDScriptParser::ClassNode::Member::SIGNAL:
@@ -1186,6 +1188,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
if (!p_types_only && base_type.is_meta_type && base_type.kind != GDScriptParser::DataType::BUILTIN && base_type.kind != GDScriptParser::DataType::ENUM) {
ScriptLanguage::CodeCompletionOption option("new", ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, ScriptLanguage::LOCATION_LOCAL);
option.insert_text += "(";
+ option.display += U"(\u2026)";
r_result.insert(option.display, option);
}
@@ -1243,10 +1246,12 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
}
int location = p_recursion_depth + _get_method_location(scr->get_class_name(), E.name);
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
- if (E.arguments.size()) {
+ if (E.arguments.size() || (E.flags & METHOD_FLAG_VARARG)) {
option.insert_text += "(";
+ option.display += U"(\u2026)";
} else {
option.insert_text += "()";
+ option.display += "()";
}
r_result.insert(option.display, option);
}
@@ -1329,10 +1334,12 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
}
int location = p_recursion_depth + _get_method_location(type, E.name);
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
- if (E.arguments.size()) {
+ if (E.arguments.size() || (E.flags & METHOD_FLAG_VARARG)) {
option.insert_text += "(";
+ option.display += U"(\u2026)";
} else {
option.insert_text += "()";
+ option.display += "()";
}
r_result.insert(option.display, option);
}
@@ -1400,10 +1407,12 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
continue;
}
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION, location);
- if (E.arguments.size()) {
+ if (E.arguments.size() || (E.flags & METHOD_FLAG_VARARG)) {
option.insert_text += "(";
+ option.display += U"(\u2026)";
} else {
option.insert_text += "()";
+ option.display += "()";
}
r_result.insert(option.display, option);
}
@@ -1435,8 +1444,10 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
ScriptLanguage::CodeCompletionOption option(String(E), ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
if (function.arguments.size() || (function.flags & METHOD_FLAG_VARARG)) {
option.insert_text += "(";
+ option.display += U"(\u2026)";
} else {
option.insert_text += "()";
+ option.display += "()";
}
r_result.insert(option.display, option);
}
@@ -1483,6 +1494,7 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
while (*kwa) {
ScriptLanguage::CodeCompletionOption option(*kwa, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
option.insert_text += "(";
+ option.display += U"(\u2026)";
r_result.insert(option.display, option);
kwa++;
}
@@ -1493,6 +1505,7 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
for (List<StringName>::Element *E = utility_func_names.front(); E; E = E->next()) {
ScriptLanguage::CodeCompletionOption option(E->get(), ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
option.insert_text += "(";
+ option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.
r_result.insert(option.display, option);
}