Ignore property groups and categories in GDScript code completion

This commit is contained in:
Yuri Sizov 2021-10-26 19:48:47 +03:00
parent fa3fc6ff0d
commit b3fc278dcf
2 changed files with 7 additions and 1 deletions

View file

@ -1511,6 +1511,12 @@ static bool _guess_identifier_type_from_base(GDScriptCompletionContext &p_contex
ClassDB::get_property_list(class_name, &props);
for (const List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
const PropertyInfo &prop = E->get();
// Ignore groups and categories in code completion.
if (prop.usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY)) {
continue;
}
if (prop.name == p_identifier) {
StringName getter = ClassDB::get_property_getter(class_name, p_identifier);
if (getter != StringName()) {

View file

@ -2937,7 +2937,7 @@ void Control::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "mouse_filter", PROPERTY_HINT_ENUM, "Stop,Pass,Ignore"), "set_mouse_filter", "get_mouse_filter");
ADD_PROPERTY(PropertyInfo(Variant::INT, "mouse_default_cursor_shape", PROPERTY_HINT_ENUM, "Arrow,Ibeam,Pointing hand,Cross,Wait,Busy,Drag,Can drop,Forbidden,Vertical resize,Horizontal resize,Secondary diagonal resize,Main diagonal resize,Move,Vertical split,Horizontal split,Help"), "set_default_cursor_shape", "get_default_cursor_shape");
ADD_GROUP("Input Propagation", "input_");
ADD_GROUP("Input", "input_");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "input_pass_on_modal_close_click"), "set_pass_on_modal_close_click", "get_pass_on_modal_close_click");
ADD_GROUP("Size Flags", "size_flags_");