WIP
This commit is contained in:
parent
bd2527e691
commit
03bcbdc33d
3 changed files with 122 additions and 0 deletions
|
@ -5,6 +5,7 @@ use anyhow::Result;
|
|||
use clock::ReplicaId;
|
||||
use collections::{HashMap, HashSet};
|
||||
use gpui::{AppContext, Entity, ModelContext, ModelHandle, Task};
|
||||
pub use language::Completion;
|
||||
use language::{
|
||||
Buffer, BufferChunks, BufferSnapshot, Chunk, DiagnosticEntry, Event, File, Language, Outline,
|
||||
OutlineItem, Selection, ToOffset as _, ToPoint as _, TransactionId,
|
||||
|
@ -847,6 +848,18 @@ impl MultiBuffer {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn completions<T>(
|
||||
&self,
|
||||
position: T,
|
||||
cx: &mut ModelContext<Self>,
|
||||
) -> Task<Result<Vec<Completion>>>
|
||||
where
|
||||
T: ToOffset,
|
||||
{
|
||||
let (buffer, text_anchor) = self.text_anchor_for_position(position, cx);
|
||||
buffer.update(cx, |buffer, cx| buffer.completions(text_anchor, cx))
|
||||
}
|
||||
|
||||
pub fn language<'a>(&self, cx: &'a AppContext) -> Option<&'a Arc<Language>> {
|
||||
self.buffers
|
||||
.borrow()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue