-
-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Better hide internal properties from users #87381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These flags are repeated a couple of times. It could be constant. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should definitely define one for |
||
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; | ||
|
Uh oh!
There was an error while loading. Please reload this page.