Partial workaround and deprecation warning for breaking change usage of #15654 (#15806)

# Description
Adds a temporary workaround to prevent #15654 from being a breaking
change when using a closure stored in a variable, and issues a warning.
Also has a special case related to
https://github.com/carapace-sh/carapace-bin/pull/2796 which suggests
re-running `carapace init`


![image](https://github.com/user-attachments/assets/783f3dbf-2a85-4aa5-ac66-efc584ac77fd)


![image](https://github.com/user-attachments/assets/c8fb5ae1-66a8-474c-8244-a22600f4da43)

# After Submitting
Remove variable name detection after grace period
This commit is contained in:
132ikl
2025-06-04 04:19:25 -04:00
committed by GitHub
parent c563e0cfb0
commit 42fc9f52a1
2 changed files with 89 additions and 15 deletions

View File

@ -1219,12 +1219,12 @@ This is an internal Nushell error, please file an issue https://github.com/nushe
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}")]
#[error("{deprecation_type} deprecated.")]
#[diagnostic(code(nu::shell::deprecated))]
DeprecationWarning {
deprecation_type: &'static str,
suggestion: String,
#[label("{suggestion}")]
span: Span,
#[help]
help: Option<&'static str>,