refactor(completion, parser): move custom_completion info from Expression to Signature (#15613)

Restricts custom completion from universal to internal arguments only.

Pros:
1. Less memory
2. More flexible for later customizations, e.g. #14923 

Cons:
1. limited customization capabilities, but at least covers all currently
existing features in nushell.

# Description

Mostly vibe coded by [Zed AI](https://zed.dev/ai) with a single prompt.
LGTM, but I'm not so sure @ysthakur 

# User-Facing Changes

Hopefully none.

# Tests + Formatting

+3

# After Submitting

---------

Co-authored-by: Yash Thakur <45539777+ysthakur@users.noreply.github.com>
This commit is contained in:
zc he
2025-07-25 02:21:58 +08:00
committed by GitHub
parent 1b01625e1e
commit 71baeff287
12 changed files with 194 additions and 144 deletions

View File

@ -45,6 +45,7 @@ fn test_signature_chained() {
shape: SyntaxShape::String,
var_id: None,
default_value: None,
custom_completion: None,
})
);
assert_eq!(
@ -55,6 +56,7 @@ fn test_signature_chained() {
shape: SyntaxShape::String,
var_id: None,
default_value: None,
custom_completion: None,
})
);
assert_eq!(
@ -65,6 +67,7 @@ fn test_signature_chained() {
shape: SyntaxShape::String,
var_id: None,
default_value: None,
custom_completion: None,
})
);
@ -78,6 +81,7 @@ fn test_signature_chained() {
desc: "required named description".to_string(),
var_id: None,
default_value: None,
custom_completion: None,
})
);
@ -91,6 +95,7 @@ fn test_signature_chained() {
desc: "required named description".to_string(),
var_id: None,
default_value: None,
custom_completion: None,
})
);
}