MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _guess_expecting_callable

Function _guess_expecting_callable

modules/gdscript/gdscript_editor.cpp:2897–2911  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2895}
2896
2897static bool _guess_expecting_callable(GDScriptParser::CompletionContext &p_context) {
2898 if (p_context.call.call != nullptr && p_context.call.call->type == GDScriptParser::Node::CALL) {
2899 GDScriptParser::CallNode *call_node = static_cast<GDScriptParser::CallNode *>(p_context.call.call);
2900 GDScriptCompletionIdentifier ci;
2901 if (_guess_expression_type(p_context, call_node->callee, ci)) {
2902 if (ci.type.kind == GDScriptParser::DataType::BUILTIN && ci.type.builtin_type == Variant::CALLABLE) {
2903 if (p_context.call.argument >= 0 && p_context.call.argument < ci.type.method_info.arguments.size()) {
2904 return ci.type.method_info.arguments.get(p_context.call.argument).type == Variant::CALLABLE;
2905 }
2906 }
2907 }
2908 }
2909
2910 return false;
2911}
2912
2913static void _find_enumeration_candidates(GDScriptParser::CompletionContext &p_context, const String &p_enum_hint, HashMap<String, ScriptLanguage::CodeCompletionOption> &r_result) {
2914 if (!p_enum_hint.contains_char('.')) {

Callers 1

complete_codeMethod · 0.85

Calls 3

_guess_expression_typeFunction · 0.85
sizeMethod · 0.65
getMethod · 0.45

Tested by

no test coverage detected