godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.05k stars 65 forks source link

Make Select Method search box case insensitive #9679

Closed Frozenfire92 closed 1 week ago

Frozenfire92 commented 1 week ago

Describe the project you are working on

any project that uses signals and connects them via the editor

Describe the problem or limitation you are having in your project

When using the Node dock to connect a signal, you are presented with two windows, the first Connect a Signal to a Method and a second Select Method. In the Select Method window, it has a search box, however this search is case sensitive. While snake_case is the convention, it is not enforced meaning scripts that have camel or pascal case methods will find this search more difficult to use

image

on search image

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

If this search was done in a case insensitive way it will be easier for users to find methods when connecting signals in the editor

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

I'm unsure how the other search boxes in engine handle, but in local testing I was able to achieve this by changing

https://github.com/godotengine/godot/blob/7ebc866418b075df58cbe4e31fcf8b0c3acd70a1/editor/connections_dialog.cpp#L285 if (!p_search_string.is_empty() && !mi.name.contains(p_search_string)) {

to

if (!p_search_string.is_empty() && !mi.name.to_lower().contains(p_search_string.to_lower())) {

and it appeared to fix this. I have submitted a PR https://github.com/godotengine/godot/pull/91598

image

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

I don't believe this can be fixed with a script/addon

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

This is core editor functionality. It also appears other parts of the editor already have case insensitive searches (for example Connect a Signal to a Method) (compare below screenshot to one above)

image