Comments (6)
I think this looks good, but I've a question: should fuzzy matching be the only option or should "exact" matching be kept as an option?
from hoard.
I'm willing to work on this as well.
from hoard.
Could I get some more specification? Do you want me to use fuzzy matching anytime we're matching on a name, or to implement the search
subcommand in a particular way?
from hoard.
Excited that you're interested!
This might be a bit more involved, since the current search is quite simple and not smart in any capacity.
When running hoard list
and typing any charactacter, apply_search is called.
The search matches any string which is contained in any struct field of all HoardCommand of the currently selected namespace
.
The main goal would be to get fuzzy matching of these struct fields. The search subcommand you are referencing is a leftover to remove since I don't see any real use for it given the GUI exists.
I think there are several ways to approach this. One of them being as follows.
Implement fuzzy_search
method for the CommandTrove ( Which is just a container for all HoardCommands
). So, something like
pub fn fuzzy_search(query_string: &str, namespace_filter: Option<String>) -> SearchResult
Where SearchResults
contains the matching command ( And optimaly a way of indicating which characters matched to later color them appropriately in the GUI, though this could be implemented as a separate PR )
Plugging this functionality into the code would happen here and here
For example like this:
&trove.fuzzy_search( &app.input, Some(selected_tab) )
( Or None
for the namespace_filter
if the selected tab is "All" )
I'm open for any changes, or totally different approaches!
Do you have input on this?
from hoard.
Good call with keeping exact matching an Option.
Maybe either a toggle able or with some kind of marker in the query string indicating that part of the string or the whole query has to match exactly
from hoard.
@PurpleMyst still considering working on this item?
from hoard.
Related Issues (20)
- Feature request: Make it compatible with Windows HOT 4
- Update trove.yaml when changing command parameter token
- suggest: read trove.yml in the current directory (or load with option) HOT 6
- Add flag to trove model wether its a local file or not global
- add Cargo.lock file to the repo HOT 2
- Allow name-based / num-based parameter tokens HOT 3
- Probably doesn't work on zsh+macos HOT 1
- add command to print shell configs HOT 2
- fix clippy lints
- Use struct arguments HOT 1
- Allow ending parameter token HOT 6
- Allow escape character HOT 2
- GUI command edit HOT 1
- GUI new command from history HOT 3
- Ubuntu .deb packages missing from releases HOT 3
- install.sh write BASH config to .zshrc not .bashrc HOT 3
- Customize tab highlight color HOT 1
- Select name space for new command HOT 1
- Named parameters using `hoard pick` are not interpreted as expected HOT 3
- Allow api_url to be configured that gets used in chatgpt_rs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hoard.