Add path completions

This commit is contained in:
JT
2021-10-05 08:21:31 +13:00
parent 2b5cc63118
commit a88058006a
12 changed files with 182 additions and 11 deletions

View File

@ -23,6 +23,8 @@ pub enum Expr {
List(Vec<Expression>),
Table(Vec<Expression>, Vec<Vec<Expression>>),
Keyword(Vec<u8>, Span, Box<Expression>),
Filepath(String),
GlobPattern(String),
String(String), // FIXME: improve this in the future?
CellPath(CellPath),
FullCellPath(Box<FullCellPath>),

View File

@ -28,7 +28,7 @@ pub enum SyntaxShape {
Int,
/// A filepath is allowed
FilePath,
Filepath,
/// A glob pattern is allowed, eg `foo*`
GlobPattern,
@ -86,7 +86,7 @@ impl SyntaxShape {
SyntaxShape::Custom(custom, _) => custom.to_type(),
SyntaxShape::Duration => Type::Duration,
SyntaxShape::Expression => Type::Unknown,
SyntaxShape::FilePath => Type::String,
SyntaxShape::Filepath => Type::String,
SyntaxShape::Filesize => Type::Filesize,
SyntaxShape::FullCellPath => Type::Unknown,
SyntaxShape::GlobPattern => Type::String,

View File

@ -12,7 +12,6 @@ pub enum Type {
Block,
CellPath,
Duration,
FilePath,
Filesize,
List(Box<Type>),
Number,
@ -32,7 +31,6 @@ impl Display for Type {
Type::Bool => write!(f, "bool"),
Type::CellPath => write!(f, "cell path"),
Type::Duration => write!(f, "duration"),
Type::FilePath => write!(f, "filepath"),
Type::Filesize => write!(f, "filesize"),
Type::Float => write!(f, "float"),
Type::Int => write!(f, "int"),