Add search terms for all?, any?, length, and keybindings (#5665)

* Add search terms for `all?`

JavaScript has `Array.every` similar to `all?`

* Add search terms for `any?`

JavaScript has `Array.some` similar to `any?`

* Add search terms for `length`

Count, `len()`, and `size`/`sizeof` in widely-known programming languages are equivalent to `length`

* Add search terms for `keybindings`

Shortcut and hotkey are common synonyms (especially in web and GUI land) for keybindings.
This commit is contained in:
Evan Platzer 2022-05-27 10:38:54 -04:00 committed by GitHub
parent 545b1dcd94
commit 6365ba0286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 0 deletions

View File

@ -27,6 +27,10 @@ impl Command for All {
"Test if every element of the input matches a predicate." "Test if every element of the input matches a predicate."
} }
fn search_terms(&self) -> Vec<&str> {
vec!["every"]
}
fn examples(&self) -> Vec<Example> { fn examples(&self) -> Vec<Example> {
vec![ vec![
Example { Example {

View File

@ -27,6 +27,10 @@ impl Command for Any {
"Tests if any element of the input matches a predicate." "Tests if any element of the input matches a predicate."
} }
fn search_terms(&self) -> Vec<&str> {
vec!["some"]
}
fn examples(&self) -> Vec<Example> { fn examples(&self) -> Vec<Example> {
vec![ vec![
Example { Example {

View File

@ -24,6 +24,10 @@ impl Command for Length {
.category(Category::Filters) .category(Category::Filters)
} }
fn search_terms(&self) -> Vec<&str> {
vec!["count", "len", "size"]
}
fn run( fn run(
&self, &self,
engine_state: &EngineState, engine_state: &EngineState,

View File

@ -21,6 +21,10 @@ impl Command for Keybindings {
"Keybindings related commands" "Keybindings related commands"
} }
fn search_terms(&self) -> Vec<&str> {
vec!["shortcut", "hotkey"]
}
fn run( fn run(
&self, &self,
engine_state: &EngineState, engine_state: &EngineState,