diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-07 13:26:32 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-07 13:26:32 +0100 |
commit | 907c3e06f6c71a4e29d52362aef3aaee722f0864 (patch) | |
tree | c71836c7ff749d76b53ed934c05dca189a3ea144 | |
parent | ce5464cb4244d73b86156cbffd87406806b5de1b (diff) | |
parent | b229a19688c09048025136221df2d8bd1471498a (diff) |
Merge pull request #69717 from Chaosus/gds_fix_lookup
Fix lookup to docs for variables initialized with `get_node`
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 6d5936ad2e..1456612915 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2624,7 +2624,7 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c } } - if (p_context.base != nullptr && subscript->is_attribute) { + if (subscript->is_attribute) { bool found_type = _get_subscript_type(p_context, subscript, base_type, &base); if (!found_type) { @@ -3288,6 +3288,7 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co parser.parse(p_code, p_path, true); GDScriptParser::CompletionContext context = parser.get_completion_context(); + context.base = p_owner; // Allows class functions with the names like built-ins to be handled properly. if (context.type != GDScriptParser::COMPLETION_ATTRIBUTE) { @@ -3460,7 +3461,9 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co break; } GDScriptCompletionIdentifier base; - if (!_guess_expression_type(context, subscript->base, base)) { + + bool found_type = _get_subscript_type(context, subscript, base.type); + if (!found_type && !_guess_expression_type(context, subscript->base, base)) { break; } |