| 2895 | } |
| 2896 | |
| 2897 | static 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 | |
| 2913 | static 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('.')) { |
no test coverage detected