Add Buffer::outline method
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
057dc62b90
commit
63a401ac5d
@@ -7,7 +7,7 @@ use collections::{HashMap, HashSet};
|
||||
use gpui::{AppContext, Entity, ModelContext, ModelHandle, Task};
|
||||
use language::{
|
||||
Buffer, BufferChunks, BufferSnapshot, Chunk, DiagnosticEntry, Event, File, Language, Selection,
|
||||
ToOffset as _, ToPoint as _, TransactionId,
|
||||
ToOffset as _, ToPoint as _, TransactionId, Outline,
|
||||
};
|
||||
use std::{
|
||||
cell::{Ref, RefCell},
|
||||
@@ -1698,6 +1698,10 @@ impl MultiBufferSnapshot {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn outline(&self) -> Option<Outline> {
|
||||
self.as_singleton().and_then(move |buffer| buffer.outline())
|
||||
}
|
||||
|
||||
fn buffer_snapshot_for_excerpt<'a>(
|
||||
&'a self,
|
||||
excerpt_id: &'a ExcerptId,
|
||||
|
||||
Reference in New Issue
Block a user