nu-cli: directory syntax shape + completions (#5299)

This commit is contained in:
Herlon Aguiar
2022-04-22 22:18:51 +02:00
committed by GitHub
parent 661283c4d2
commit 5ff2ae628b
15 changed files with 211 additions and 9 deletions

View File

@@ -25,6 +25,7 @@ pub enum FlatShape {
Record,
Block,
Filepath,
Directory,
DateTime,
GlobPattern,
Variable,
@@ -56,6 +57,7 @@ impl Display for FlatShape {
FlatShape::Record => write!(f, "shape_record"),
FlatShape::Block => write!(f, "shape_block"),
FlatShape::Filepath => write!(f, "shape_filepath"),
FlatShape::Directory => write!(f, "shape_directory"),
FlatShape::GlobPattern => write!(f, "shape_globpattern"),
FlatShape::Variable => write!(f, "shape_variable"),
FlatShape::Flag => write!(f, "shape_flag"),
@@ -279,6 +281,9 @@ pub fn flatten_expression(
Expr::Filepath(_) => {
vec![(expr.span, FlatShape::Filepath)]
}
Expr::Directory(_) => {
vec![(expr.span, FlatShape::Directory)]
}
Expr::GlobPattern(_) => {
vec![(expr.span, FlatShape::GlobPattern)]
}