Fix completion crash (#3574)

This commit is contained in:
JT
2021-06-08 18:56:36 +12:00
committed by GitHub
parent 4e6c2c0fa1
commit bc6fa85a4b

View File

@ -54,7 +54,14 @@ impl NuCompleter {
if locations.is_empty() {
(pos, Vec::new())
} else {
let pos = locations[0].span.start();
let mut pos = locations[0].span.start();
for location in &locations {
if location.span.start() < pos {
pos = location.span.start();
}
}
let suggestions = locations
.into_iter()
.flat_map(|location| {