better it detection and block params in shapes

This commit is contained in:
JT
2021-09-13 19:54:13 +12:00
parent eb67eab122
commit 32c1f0c8d4
9 changed files with 64 additions and 30 deletions

View File

@ -34,7 +34,7 @@ pub enum SyntaxShape {
GlobPattern,
/// A block is allowed, eg `{start this thing}`
Block(Vec<(Vec<u8>, SyntaxShape)>),
Block(Option<Vec<SyntaxShape>>),
/// A table is allowed, eg `[[first, second]; [1, 2]]`
Table,
@ -75,7 +75,7 @@ impl SyntaxShape {
pub fn to_type(&self) -> Type {
match self {
SyntaxShape::Any => Type::Unknown,
SyntaxShape::Block => Type::Block,
SyntaxShape::Block(_) => Type::Block,
SyntaxShape::CellPath => Type::Unknown,
SyntaxShape::Duration => Type::Duration,
SyntaxShape::Expression => Type::Unknown,