Improve completions inside of a pipeline (#3575)

* Fix completion crash

* Improve inner completions
This commit is contained in:
JT 2021-06-08 19:48:02 +12:00 committed by GitHub
parent bc6fa85a4b
commit 2e968d2557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,11 +228,13 @@ pub fn completion_location(line: &str, block: &Block, pos: usize) -> Vec<Complet
item: LocationType::Command,
} = &rloc
{
output.push(LocationType::Command.spanned(Span::new(
span.start(),
locations[locations.len() - 1].span.end(),
)));
break;
if span.start() <= pos {
output.push(
LocationType::Command
.spanned(Span::new(span.start(), pos)),
);
break;
}
}
}