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

@ -16,6 +16,7 @@ pub enum FlatShape {
Signature,
String,
Variable,
Custom(String),
}
pub fn flatten_block(working_set: &StateWorkingSet, block: &Block) -> Vec<(Span, FlatShape)> {
@ -40,6 +41,10 @@ pub fn flatten_expression(
working_set: &StateWorkingSet,
expr: &Expression,
) -> Vec<(Span, FlatShape)> {
if let Some(custom_completion) = &expr.custom_completion {
return vec![(expr.span, FlatShape::Custom(custom_completion.clone()))];
}
match &expr.expr {
Expr::BinaryOp(lhs, op, rhs) => {
let mut output = vec![];