Skip to content

Commit

Permalink
Merge pull request #86111 from HolonProduction/get-node-fixup
Browse files Browse the repository at this point in the history
Fix regression when autocompleting subscript on get node
  • Loading branch information
akien-mga committed Dec 13, 2023
2 parents 7635530 + 5f72254 commit aa5b6ed
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down

0 comments on commit aa5b6ed

Please sign in to comment.