add is_const to help commands and scope commands (#14125)

# Description

This PR adds `is_const` to `help commands` and `scope commands` so we
can see which commands are const commands.


![image](https://github.com/user-attachments/assets/f2269f9d-5042-40e4-b506-34d69096fcd1)
This commit is contained in:
Darren Schroeder 2024-10-21 05:54:18 -05:00 committed by GitHub
parent 8c8f795e9e
commit 8d4426f2f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -220,6 +220,7 @@ fn build_help_commands(engine_state: &EngineState, span: Span) -> Vec<Value> {
"params" => param_table,
"input_output" => input_output_table,
"search_terms" => Value::string(search_terms.join(", "), span),
"is_const" => Value::bool(decl.is_const(), span),
};
found_cmds_vec.push(Value::record(record, span));

View File

@ -113,6 +113,7 @@ impl<'e, 's> ScopeData<'e, 's> {
"examples" => Value::list(examples, span),
"type" => Value::string(decl.command_type().to_string(), span),
"is_sub" => Value::bool(decl.is_sub(), span),
"is_const" => Value::bool(decl.is_const(), span),
"creates_scope" => Value::bool(signature.creates_scope, span),
"extra_description" => Value::string(decl.extra_description(), span),
"search_terms" => Value::string(decl.search_terms().join(", "), span),