forked from extern/nushell
Remove Signature.vectorizes_over_list
entirely (#9777)
# Description With the current typechecking logic this property has no effect. It was only used in the example testing, and provided some indication of this vectorizing property. With #9742 all commands that previously declared it have explicit list signatures. If we want to get it back in the future we can reconstruct it from the signature. Simplifies the example testing a bit. # User-Facing Changes Causes a breaking change for plugins that previously declared it. While this causes a compile fail, this was already broken by our more stringent type checking. This will be a good reminder for plugin authors to update their signature as well to reflect the more stringent type checking.
This commit is contained in:
committed by
GitHub
parent
d9230a76f3
commit
b2e191f836
@ -54,7 +54,6 @@ impl Command for Fill {
|
||||
// General case for heterogeneous lists
|
||||
(Type::List(Box::new(Type::Any)), Type::List(Box::new(Type::String))),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
"width",
|
||||
|
@ -46,7 +46,6 @@ impl Command for SubCommand {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
|
@ -70,7 +70,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Int)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.named("radix", SyntaxShape::Number, "radix of integer", Some('r'))
|
||||
.switch("little-endian", "use little-endian byte decoding", None)
|
||||
|
@ -46,7 +46,6 @@ mod test_examples {
|
||||
&mut make_engine_state(cmd.clone_box()),
|
||||
&signature.input_output_types,
|
||||
signature.operates_on_cell_paths(),
|
||||
signature.vectorizes_over_list,
|
||||
),
|
||||
);
|
||||
check_example_evaluates_to_expected_output(&example, cwd.as_path(), &mut engine_state);
|
||||
|
@ -19,7 +19,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Number)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Math)
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Number)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Math)
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Number)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Math)
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ impl Command for SubCommand {
|
||||
),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.category(Category::Math)
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Number)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
"precision",
|
||||
|
@ -19,7 +19,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::Number)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Math)
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ impl Command for SubCommand {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.switch(
|
||||
"all",
|
||||
"encode all non-alphanumeric chars including `/`, `.`, `:`",
|
||||
|
@ -29,7 +29,6 @@ impl Command for DecodeBase64 {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
"character-set",
|
||||
|
@ -35,7 +35,6 @@ impl Command for EncodeBase64 {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
"character-set",
|
||||
|
@ -20,7 +20,6 @@ impl Command for SubCommand {
|
||||
(Type::String, Type::List(Box::new(Type::String))),
|
||||
(Type::List(Box::new(Type::String)), Type::Table(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.required(
|
||||
"separator",
|
||||
|
@ -26,7 +26,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -24,7 +24,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -24,7 +24,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -26,7 +26,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::String)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -26,7 +26,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::String)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -25,7 +25,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -25,7 +25,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -26,7 +26,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -23,7 +23,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -36,7 +36,6 @@ impl Command for SubCommand {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
(Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Bool)))
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.required("string", SyntaxShape::String, "the substring to find")
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -35,7 +35,6 @@ impl Command for SubCommand {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.required("string", SyntaxShape::String, "the string to match")
|
||||
.rest(
|
||||
"rest",
|
||||
|
@ -29,7 +29,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::List(Box::new(Type::String)))),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.category(Category::Strings)
|
||||
}
|
||||
|
@ -43,7 +43,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true) // TODO: no test coverage
|
||||
.allow_variants_without_examples(true)
|
||||
.required("string", SyntaxShape::String, "the string to find in the input")
|
||||
.switch(
|
||||
|
@ -36,7 +36,6 @@ impl Command for SubCommand {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.switch(
|
||||
"grapheme-clusters",
|
||||
"count length using grapheme clusters (all visible chars have length 1)",
|
||||
|
@ -44,7 +44,6 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::String)),
|
||||
),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.required("find", SyntaxShape::String, "the pattern to find")
|
||||
.required("replace", SyntaxShape::String, "the replacement string")
|
||||
.rest(
|
||||
|
@ -26,7 +26,6 @@ impl Command for SubCommand {
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.vectorizes_over_list(true)
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::CellPath,
|
||||
|
@ -36,7 +36,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.required("string", SyntaxShape::String, "the string to match")
|
||||
.rest(
|
||||
|
@ -48,7 +48,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.switch(
|
||||
"grapheme-clusters",
|
||||
|
@ -44,7 +44,6 @@ impl Command for SubCommand {
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.vectorizes_over_list(true)
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
"rest",
|
||||
|
Reference in New Issue
Block a user