bevyengine / bevyengine/bevy

Entity search function should support PascalCase-sensitive searches

Open
#25,029 1 comment 0 reactions 0 assignees View on GitHub
A-Dev-Tools C-Feature D-Modest S-Blocked X-Uncontroversial
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

ECS components are required to have PascalCase names, since they are Rust types. In the past, I have found it very handy to have the search function know about PascalCase names, similar to what VSCode does.

This would work in parallel with the normal fuzzy and prefix search function, the user would not have to explicitly choose PascalCase mode.

Searching should happen as you type into the search box, which means that all searches should implicitly be prefix searches: each character you type narrows the search further.

Thus, typing the string "do" would match all of the following component names:

* door (because it's a prefix match)
* Door (because searches are case-insensitive)
* DangerousOoze (because the words start with "d" and "o")
* DangerousOozeRed (because PascaleCase searches are also prefix searches)

On the other hand, if you type the string "Do", then the search algorithm, detecting a mixed-case string, would automatically switch to case sensitive mode and disable PascalCase mode, so only "Door" would match.

## What solution would you like?

PascalCase matching can be done easily by transforming the input string into a regular expression.

@alice-i-cecile

Contributor guide

Open the contributing guide

Research direction

Start by locating the entity search function and the search-box input handling described in the issue. Verify the existing fuzzy and prefix behavior, then define the PascalCase and mixed-case examples as search cases; done means typing narrows results as specified without requiring a separate mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.