generalize extend selection to work with nodes

This commit is contained in:
Aleksey Kladov 2018-12-31 19:01:51 +03:00
parent a3ee07ac14
commit f1e8ebfbeb
3 changed files with 22 additions and 21 deletions

View file

@ -102,7 +102,7 @@ fn selections(file: &SourceFileNode, start: u32, end: u32) -> String {
let mut cur = Some(TextRange::from_to((start - 1).into(), (end - 1).into()));
while let Some(r) = cur {
ranges.push(r);
cur = extend_selection(&file, r);
cur = extend_selection(file.syntax(), r);
}
let ranges = ranges
.iter()