Better hide internal properties from users
This commit is contained in:
@ -1135,7 +1135,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
|
||||
List<PropertyInfo> members;
|
||||
scr->get_script_property_list(&members);
|
||||
for (const PropertyInfo &E : members) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_INTERNAL)) {
|
||||
continue;
|
||||
}
|
||||
if (E.name.contains("/")) {
|
||||
@ -1210,7 +1210,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
|
||||
List<PropertyInfo> pinfo;
|
||||
ClassDB::get_property_list(type, &pinfo);
|
||||
for (const PropertyInfo &E : pinfo) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_INTERNAL)) {
|
||||
continue;
|
||||
}
|
||||
if (E.name.contains("/")) {
|
||||
@ -1273,7 +1273,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
|
||||
}
|
||||
|
||||
for (const PropertyInfo &E : members) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) {
|
||||
if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_INTERNAL)) {
|
||||
continue;
|
||||
}
|
||||
if (!String(E.name).contains("/")) {
|
||||
@ -3514,6 +3514,12 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
||||
}
|
||||
|
||||
if (ClassDB::has_property(class_name, p_symbol, true)) {
|
||||
PropertyInfo prop_info;
|
||||
ClassDB::get_property_info(class_name, p_symbol, &prop_info, true);
|
||||
if (prop_info.usage & PROPERTY_USAGE_INTERNAL) {
|
||||
return ERR_CANT_RESOLVE;
|
||||
}
|
||||
|
||||
r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_PROPERTY;
|
||||
r_result.class_name = base_type.native_type;
|
||||
r_result.class_member = p_symbol;
|
||||
|
||||
Reference in New Issue
Block a user