Skip to content
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

Ignore property groups and categories in GDScript code completion #54272

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_");
Expand Down