1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix regression when autocompleting subscript on get node

This commit is contained in:
HolonProduction
2023-12-13 10:51:07 +01:00
parent bbf64a5cea
commit 5f72254d4d

View File

@@ -2676,10 +2676,6 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co
if (p_context.base == nullptr) { if (p_context.base == nullptr) {
return false; 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; const GDScriptParser::GetNodeNode *get_node = nullptr;
@@ -2689,6 +2685,11 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co
} break; } break;
case GDScriptParser::Node::IDENTIFIER: { 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); const GDScriptParser::IdentifierNode *identifier_node = static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base);
switch (identifier_node->source) { switch (identifier_node->source) {