Autocompletion: Remove duplicate code

This commit is contained in:
HolonProduction 2025-08-04 12:59:22 +02:00
parent 2d113cc224
commit 8ec31b7b3d

View file

@ -1791,18 +1791,6 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
found = true; found = true;
} else { } else {
switch (p_expression->type) { switch (p_expression->type) {
case GDScriptParser::Node::LITERAL: {
const GDScriptParser::LiteralNode *literal = static_cast<const GDScriptParser::LiteralNode *>(p_expression);
r_type = _type_from_variant(literal->value, p_context);
found = true;
} break;
case GDScriptParser::Node::SELF: {
if (p_context.current_class) {
r_type.type = p_context.current_class->get_datatype();
r_type.type.is_meta_type = false;
found = true;
}
} break;
case GDScriptParser::Node::IDENTIFIER: { case GDScriptParser::Node::IDENTIFIER: {
const GDScriptParser::IdentifierNode *id = static_cast<const GDScriptParser::IdentifierNode *>(p_expression); const GDScriptParser::IdentifierNode *id = static_cast<const GDScriptParser::IdentifierNode *>(p_expression);
found = _guess_identifier_type(p_context, id, r_type); found = _guess_identifier_type(p_context, id, r_type);