parent
c79183817d
commit
0803467334
1 changed files with 28 additions and 0 deletions
|
@ -3533,6 +3533,33 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case GDScriptParser::COMPLETION_TYPE_ATTRIBUTE: {
|
||||||
|
if (context.node == nullptr || context.node->type != GDScriptParser::Node::TYPE) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const GDScriptParser::TypeNode *type = static_cast<const GDScriptParser::TypeNode *>(context.node);
|
||||||
|
|
||||||
|
GDScriptParser::DataType base_type;
|
||||||
|
const GDScriptParser::IdentifierNode *prev = nullptr;
|
||||||
|
for (const GDScriptParser::IdentifierNode *E : type->type_chain) {
|
||||||
|
if (E->name == p_symbol && prev != nullptr) {
|
||||||
|
base_type = prev->get_datatype();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
prev = E;
|
||||||
|
}
|
||||||
|
if (base_type.kind != GDScriptParser::DataType::CLASS) {
|
||||||
|
GDScriptCompletionIdentifier base;
|
||||||
|
if (!_guess_expression_type(context, prev, base)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
base_type = base.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_lookup_symbol_from_base(base_type, p_symbol, is_function, r_result) == OK) {
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case GDScriptParser::COMPLETION_OVERRIDE_METHOD: {
|
case GDScriptParser::COMPLETION_OVERRIDE_METHOD: {
|
||||||
GDScriptParser::DataType base_type = context.current_class->base_type;
|
GDScriptParser::DataType base_type = context.current_class->base_type;
|
||||||
|
|
||||||
|
@ -3540,6 +3567,7 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
case GDScriptParser::COMPLETION_PROPERTY_DECLARATION_OR_TYPE:
|
||||||
case GDScriptParser::COMPLETION_TYPE_NAME_OR_VOID:
|
case GDScriptParser::COMPLETION_TYPE_NAME_OR_VOID:
|
||||||
case GDScriptParser::COMPLETION_TYPE_NAME: {
|
case GDScriptParser::COMPLETION_TYPE_NAME: {
|
||||||
GDScriptParser::DataType base_type = context.current_class->get_datatype();
|
GDScriptParser::DataType base_type = context.current_class->get_datatype();
|
||||||
|
|
Loading…
Reference in a new issue