Include highlighting runs in Outline

This commit is contained in:
Max Brunsfeld 2022-01-13 14:46:15 -08:00
parent 3e1c559b2d
commit 7913a1ea22
5 changed files with 36 additions and 10 deletions

View file

@ -1698,9 +1698,9 @@ impl MultiBufferSnapshot {
})
}
pub fn outline(&self) -> Option<Outline<Anchor>> {
pub fn outline(&self, theme: Option<&SyntaxTheme>) -> Option<Outline<Anchor>> {
let buffer = self.as_singleton()?;
let outline = buffer.outline()?;
let outline = buffer.outline(theme)?;
let excerpt_id = &self.excerpts.iter().next().unwrap().id;
Some(Outline::new(
outline
@ -1711,6 +1711,7 @@ impl MultiBufferSnapshot {
range: self.anchor_in_excerpt(excerpt_id.clone(), item.range.start)
..self.anchor_in_excerpt(excerpt_id.clone(), item.range.end),
text: item.text,
text_runs: item.text_runs,
name_ranges: item.name_ranges,
})
.collect(),