diff --git a/crates/nu-engine/src/documentation.rs b/crates/nu-engine/src/documentation.rs index 0f95968f22..6ca56750c3 100644 --- a/crates/nu-engine/src/documentation.rs +++ b/crates/nu-engine/src/documentation.rs @@ -321,7 +321,7 @@ fn get_documentation( // document shape helps showing more useful information pub fn document_shape(shape: SyntaxShape) -> SyntaxShape { match shape { - SyntaxShape::Custom(inner_shape, _) => *inner_shape, + SyntaxShape::CompleterWrapper(inner_shape, _) => *inner_shape, _ => shape, } } diff --git a/crates/nu-engine/src/scope.rs b/crates/nu-engine/src/scope.rs index 04ad70ecc3..51a505e2a0 100644 --- a/crates/nu-engine/src/scope.rs +++ b/crates/nu-engine/src/scope.rs @@ -573,7 +573,7 @@ impl<'e, 's> ScopeData<'e, 's> { fn extract_custom_completion_from_arg(engine_state: &EngineState, shape: &SyntaxShape) -> String { return match shape { - SyntaxShape::Custom(_, custom_completion_decl_id) => { + SyntaxShape::CompleterWrapper(_, custom_completion_decl_id) => { let custom_completion_command = engine_state.get_decl(*custom_completion_decl_id); let custom_completion_command_name: &str = custom_completion_command.name(); custom_completion_command_name.to_string() diff --git a/crates/nu-parser/src/parser.rs b/crates/nu-parser/src/parser.rs index 5e83d809d3..2a7392c9de 100644 --- a/crates/nu-parser/src/parser.rs +++ b/crates/nu-parser/src/parser.rs @@ -2759,7 +2759,7 @@ pub fn parse_shape_name( let decl_id = working_set.find_decl(command_name); if let Some(decl_id) = decl_id { - return SyntaxShape::Custom(Box::new(shape), decl_id); + return SyntaxShape::CompleterWrapper(Box::new(shape), decl_id); } else { working_set.error(ParseError::UnknownCommand(cmd_span)); return shape; @@ -4666,7 +4666,7 @@ pub fn parse_value( } match shape { - SyntaxShape::Custom(shape, custom_completion) => { + SyntaxShape::CompleterWrapper(shape, custom_completion) => { let mut expression = parse_value(working_set, span, shape); expression.custom_completion = Some(*custom_completion); expression diff --git a/crates/nu-protocol/src/syntax_shape.rs b/crates/nu-protocol/src/syntax_shape.rs index f288f44dd1..669a7b2044 100644 --- a/crates/nu-protocol/src/syntax_shape.rs +++ b/crates/nu-protocol/src/syntax_shape.rs @@ -29,8 +29,8 @@ pub enum SyntaxShape { /// A closure is allowed, eg `{|| start this thing}` Closure(Option>), - /// A custom shape with custom completion logic - Custom(Box, DeclId), + /// A [`SyntaxShape`] with custom completion logic + CompleterWrapper(Box, 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(", ");