diff options
author | HolonProduction <holonproduction@gmail.com> | 2023-12-13 10:51:07 +0100 |
---|---|---|
committer | HolonProduction <holonproduction@gmail.com> | 2023-12-13 10:54:40 +0100 |
commit | 5f72254d4db824b50dc30548fd031874fc5a418c (patch) | |
tree | f1c2edc7c9ee231805061d3a9b1c4b866a27aa82 /modules/gdscript/gdscript_editor.cpp | |
parent | bbf64a5cea1d0cb02f9ae9245a9ee7711752a2c0 (diff) | |
download | redot-engine-5f72254d4db824b50dc30548fd031874fc5a418c.tar.gz |
Fix regression when autocompleting subscript on get node
Diffstat (limited to 'modules/gdscript/gdscript_editor.cpp')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index faaff53344..4ab3e9f5ad 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2676,10 +2676,6 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co if (p_context.base == nullptr) { return false; } - if (p_subscript->base->datatype.type_source == GDScriptParser::DataType::ANNOTATED_EXPLICIT) { - // Annotated type takes precedence. - return false; - } const GDScriptParser::GetNodeNode *get_node = nullptr; @@ -2689,6 +2685,11 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co } break; case GDScriptParser::Node::IDENTIFIER: { + if (p_subscript->base->datatype.type_source == GDScriptParser::DataType::ANNOTATED_EXPLICIT) { + // Annotated type takes precedence. + return false; + } + const GDScriptParser::IdentifierNode *identifier_node = static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base); switch (identifier_node->source) { |