Very early proof-of-concept git branch completion

This commit is contained in:
JT
2021-09-14 16:59:46 +12:00
parent 7b54e5c4ab
commit b4f918b889
11 changed files with 293 additions and 4 deletions

View File

@ -69,6 +69,9 @@ pub enum SyntaxShape {
/// A general expression, eg `1 + 2` or `foo --bar`
Expression,
/// A custom shape with custom completion logic
Custom(Box<SyntaxShape>, String),
}
impl SyntaxShape {
@ -77,6 +80,7 @@ impl SyntaxShape {
SyntaxShape::Any => Type::Unknown,
SyntaxShape::Block(_) => Type::Block,
SyntaxShape::CellPath => Type::Unknown,
SyntaxShape::Custom(custom, _) => custom.to_type(),
SyntaxShape::Duration => Type::Duration,
SyntaxShape::Expression => Type::Unknown,
SyntaxShape::FilePath => Type::FilePath,