Repository: nushell/nushell
File: crates/nu-protocol/src/errors/shell_error.rs (Rust)

Code before:
    #[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.")
    )]
    NotAConstCommand {
        #[label("This command cannot run at parse time.")]
        span: Span,
    },

    /// Tried getting a help message at parse time.
    ///
    /// ## Resolution
    ///
    /// Help messages are not supported at parse time.
    #[error("Help message not a constant.")]
    #[diagnostic(
        code(nu::shell::not_a_const_help),
        help("Help messages are currently not supported to be constants.")
    )]
    NotAConstHelp {
        #[label("This command cannot run at parse time.")]
        span: Span,
    },

    #[error("Deprecated: {old_command}")]
    #[diagnostic(help("for more info see {url}"))]
    Deprecated {
        old_command: String,
        new_suggestion: String,
        #[label("`{old_command}` is deprecated and will be removed in a future release. Please {new_suggestion} instead.")]
        span: Span,
        url: String,
    },

    /// Invalid glob pattern
    ///
    /// ## Resolution
    ///
    /// Correct glob pattern
    #[error("Invalid glob pattern")]
    #[diagnostic(
        code(nu::shell::invalid_glob_pattern),
        help("Refer to xxx for help on nushell glob patterns.")
    )]
    InvalidGlobPattern {
        msg: String,
        #[label("{msg}")]
        span: Span,
    },

    /// Tried spreading a non-list inside a list or command call.

Review comment (refactor):
Did we ever satisfy that with useful URLs :P ? 
Slightly worried with those half sentence format strings, when folks may treat that as free text and never check the format string but deprecation warnings shouldn't live too long.

Code after:
    #[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.")
    )]
    NotAConstCommand {
        #[label("This command cannot run at parse time.")]
        span: Span,
    },

    /// Tried getting a help message at parse time.
    ///
    /// ## Resolution
    ///
    /// Help messages are not supported at parse time.
    #[error("Help message not a constant.")]
    #[diagnostic(
        code(nu::shell::not_a_const_help),
        help("Help messages are currently not supported to be constants.")
    )]
    NotAConstHelp {
        #[label("This command cannot run at parse time.")]
        span: Span,
    },

    #[error("{deprecated} is deprecated and will be removed in a future release")]
    #[diagnostic()]
    Deprecated {
        deprecated: &'static str,
        suggestion: &'static str,
        #[label("{deprecated} is deprecated. {suggestion}")]
        span: Span,
        #[help]
        help: Option<&'static str>,
    },

    /// Invalid glob pattern
    ///
    /// ## Resolution
    ///
    /// Correct glob pattern
    #[error("Invalid glob pattern")]
    #[diagnostic(
        code(nu::shell::invalid_glob_pattern),
        help("Refer to xxx for help on nushell glob patterns.")
    )]
    InvalidGlobPattern {
        msg: String,
        #[label("{msg}")]
        span: Span,
    },