diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-12-13 12:21:05 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-12-13 12:21:05 +0100 |
commit | aa5b6ed13e4644633baf2a8a1384c82e91c533a1 (patch) | |
tree | 453a4392928cda2ab1b48d5a489a1a4793b9e0d9 | |
parent | 7635530e11aa20495301f07eb7a4085fcf83c60a (diff) | |
parent | 5f72254d4db824b50dc30548fd031874fc5a418c (diff) | |
download | redot-engine-aa5b6ed13e4644633baf2a8a1384c82e91c533a1.tar.gz |
Merge pull request #86111 from HolonProduction/get-node-fixup
Fix regression when autocompleting subscript on get node
-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) { |