mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 18:25:29 +02:00
Fix error message: custom commands cannot be const
(#16393)
# Description Fixes the error you get when you parse something like `const c = random int` to no longer imply that custom commands can be `const`. My understanding is that they currently cannot (though that feature is being tracked at #15074). # User-Facing Changes * Improved error message --------- Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
@@ -1186,18 +1186,16 @@ This is an internal Nushell error, please file an issue https://github.com/nushe
|
||||
span: Span,
|
||||
},
|
||||
|
||||
// TODO: Update help text once custom const commands are supported
|
||||
/// Tried running a command that is not const-compatible
|
||||
///
|
||||
/// ## Resolution
|
||||
///
|
||||
/// Only a subset of builtin commands, and custom commands built only from those commands, can
|
||||
/// run at parse time.
|
||||
/// Only a subset of builtin commands can run at parse time.
|
||||
#[error("Not a const command.")]
|
||||
#[diagnostic(
|
||||
code(nu::shell::not_a_const_command),
|
||||
help(
|
||||
"Only a subset of builtin commands, and custom commands built only from those commands, can run at parse time."
|
||||
)
|
||||
help("Only a subset of builtin commands can run at parse time.")
|
||||
)]
|
||||
NotAConstCommand {
|
||||
#[label("This command cannot run at parse time.")]
|
||||
|
Reference in New Issue
Block a user