Rename SyntaxShape::Custom to CompleterWrapper (#10548)

# Description
The description `Custom` doesn't really reflect meaning in the set of
`SyntaxShape`. Makes it a bit more verbose but explicit


# User-Facing Changes
Only hypothetically breaking as plugins can not effectively use a
requirement on `SyntaxShape::Custom`.

# Tests + Formatting
(-)
This commit is contained in:
Stefan Holderbach
2023-09-29 19:22:58 +02:00
committed by GitHub
parent cc4f8bbd82
commit 9e445fd4c5
4 changed files with 8 additions and 8 deletions

View File

@ -29,8 +29,8 @@ pub enum SyntaxShape {
/// A closure is allowed, eg `{|| start this thing}`
Closure(Option<Vec<SyntaxShape>>),
/// A custom shape with custom completion logic
Custom(Box<SyntaxShape>, DeclId),
/// A [`SyntaxShape`] with custom completion logic
CompleterWrapper(Box<SyntaxShape>, DeclId),
/// A datetime value, eg `2022-02-02` or `2019-10-12T07:20:50.52+00:00`
DateTime,
@ -144,7 +144,7 @@ impl SyntaxShape {
SyntaxShape::Closure(_) => Type::Closure,
SyntaxShape::Binary => Type::Binary,
SyntaxShape::CellPath => Type::Any,
SyntaxShape::Custom(custom, _) => custom.to_type(),
SyntaxShape::CompleterWrapper(inner, _) => inner.to_type(),
SyntaxShape::DateTime => Type::Date,
SyntaxShape::Duration => Type::Duration,
SyntaxShape::Expression => Type::Any,
@ -245,7 +245,7 @@ impl Display for SyntaxShape {
SyntaxShape::Expression => write!(f, "expression"),
SyntaxShape::Boolean => write!(f, "bool"),
SyntaxShape::Error => write!(f, "error"),
SyntaxShape::Custom(x, _) => write!(f, "custom<{x}>"),
SyntaxShape::CompleterWrapper(x, _) => write!(f, "completable<{x}>"),
SyntaxShape::OneOf(list) => {
let arg_vec: Vec<_> = list.iter().map(|x| x.to_string()).collect();
let arg_string = arg_vec.join(", ");