feat: Search terms for use, while, and range (#5093) (#10265)

# Description

Add search terms to the commands: `use` ("environment", "import"),
`while` ("loop"), and `range` ("filter", "head", "tail").

# Tests + Formatting
All completed successfully.

---------

Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
Marshall Bruner 2023-09-07 22:11:42 +02:00 committed by GitHub
parent f021be623e
commit f78d57a703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,10 @@ impl Command for Use {
.category(Category::Core) .category(Category::Core)
} }
fn search_terms(&self) -> Vec<&str> {
vec!["module", "import", "include", "scope"]
}
fn extra_usage(&self) -> &str { fn extra_usage(&self) -> &str {
r#"See `help std` for the standard library module. r#"See `help std` for the standard library module.
See `help modules` to list all available modules. See `help modules` to list all available modules.

View File

@ -30,6 +30,10 @@ impl Command for While {
.category(Category::Core) .category(Category::Core)
} }
fn search_terms(&self) -> Vec<&str> {
vec!["loop"]
}
fn run( fn run(
&self, &self,
engine_state: &EngineState, engine_state: &EngineState,

View File

@ -33,6 +33,10 @@ impl Command for Range {
"Return only the selected rows." "Return only the selected rows."
} }
fn search_terms(&self) -> Vec<&str> {
vec!["filter", "head", "tail"]
}
fn examples(&self) -> Vec<Example> { fn examples(&self) -> Vec<Example> {
vec![ vec![
Example { Example {