Return Outline<Anchor> from MultiBuffer::outline

Co-Authored-By: Max Brunsfeld <max@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-13 18:24:00 +01:00
parent e165f1e16c
commit 2660d37ad8
4 changed files with 31 additions and 15 deletions

View file

@ -1835,7 +1835,7 @@ impl BufferSnapshot {
}
}
pub fn outline(&self) -> Option<Outline> {
pub fn outline(&self) -> Option<Outline<Anchor>> {
let tree = self.tree.as_ref()?;
let grammar = self
.language
@ -1910,7 +1910,7 @@ impl BufferSnapshot {
Some(OutlineItem {
id,
depth: stack.len() - 1,
range,
range: self.anchor_after(range.start)..self.anchor_before(range.end),
text,
name_range_in_text,
})