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

Add autocompletion for groups #8561

Closed
Cronos87 opened this issue Dec 1, 2023 · 4 comments
Closed

Add autocompletion for groups #8561

Cronos87 opened this issue Dec 1, 2023 · 4 comments

Comments

@Cronos87
Copy link

Cronos87 commented Dec 1, 2023

Describe the project you are working on

Any projects.

Describe the problem or limitation you are having in your project

When I add a node in a group, there is no autocompletion in the divers functions that uses groups.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

When adding a node to a group, Godot will remember the names and save them in the .godot directory. By doing so, when using group methods, it will be able to autocomplete the group's name in the editor.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Autocompletion will be activated when the cursor is on the first parameter of the following methods:

  • Node.is_in_group()
  • Node.remove_from_group()
  • get_tree().get_nodes_in_group()

This is similar to Input.is_action_just_released() and other methods similar to this one. Godot will autocomplete with the input filled according to the project's settings.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I think it will be useful for everyone but I don't know if it can be done using an addon.

Is there a reason why this should be core and not an add-on in the asset library?

It would be lovely to have it in the core, as more developers can benefit from it.

@Mickeon
Copy link

Mickeon commented Dec 1, 2023

This will basically be "free" when global groups are implemented godotengine/godot#60965.

@Cronos87
Copy link
Author

Cronos87 commented Dec 1, 2023

I didn't know about this! It looks so much cleaner in this way! It could be a good complement to it.

Edit: Global groups have been merged godotengine/godot#60965 🎉.

@Mickeon
Copy link

Mickeon commented Dec 30, 2023

They have been merged, and as a bonus of the PR, "global" groups appear in the autocomplete suggestions for the Node and SceneTree's group methods. This proposal can be closed now.

@Cronos87
Copy link
Author

That works like a charm! I can close this proposal. Thanks a lot to the team!

@AThousandShips AThousandShips added this to the 4.3 milestone Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants