Map the editor-frontend API

Co-authored-by: Lukas Wirth <lukas@zed.dev>
This commit is contained in:
Kirill Bulatov 2025-08-26 12:42:22 +03:00
parent 5cf3dcfdfd
commit 44b1d5db2d
2 changed files with 204 additions and 235 deletions

View file

@ -24,12 +24,7 @@ pub struct BufferInlayHints {
#[derive(Debug, Default)]
struct HintChunks {
hints_by_chunks: BTreeMap<Range<BufferRow>, Option<Vec<InlayHintId>>>,
chunk_updates: HashMap<Range<BufferRow>, Shared<Task<InlayHints>>>,
}
pub struct InlayHints {
pub cache_version: usize,
pub hints: Vec<InlayHint>,
chunk_updates: HashMap<Range<BufferRow>, Shared<Task<Vec<InlayHint>>>>,
}
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
@ -54,7 +49,7 @@ impl BufferInlayHints {
strategy: HintFetchStrategy,
range: impl text::ToOffset,
cx: &mut Context<Self>,
) -> Option<(Range<BufferRow>, Shared<Task<InlayHints>>)> {
) -> Option<(Range<BufferRow>, Shared<Task<Vec<InlayHint>>>)> {
todo!("TODO kb")
}
// we want to store the cache version outbound, so they can query with it: we can return nothing (`Option`) if the version matches