Forward inlay hint refresh requests to clients, test coop inlay hints

This commit is contained in:
Kirill Bulatov 2023-06-23 21:01:07 +03:00
parent a68e68a0d9
commit 890b164278
7 changed files with 366 additions and 13 deletions

View file

@ -7596,6 +7596,10 @@ impl Editor {
pub fn next_inlay_id(&mut self) -> InlayId {
InlayId(post_inc(&mut self.next_inlay_id))
}
pub fn inlay_hint_cache(&self) -> &InlayHintCache {
&self.inlay_hint_cache
}
}
fn consume_contiguous_rows(

View file

@ -24,16 +24,18 @@ struct InlayHintUpdateTask {
_task: Task<()>,
}
struct CacheSnapshot {
hints: HashMap<ExcerptId, Arc<CachedExcerptHints>>,
allowed_hint_kinds: HashSet<Option<InlayHintKind>>,
version: usize,
#[derive(Debug)]
pub struct CacheSnapshot {
pub hints: HashMap<ExcerptId, Arc<CachedExcerptHints>>,
pub allowed_hint_kinds: HashSet<Option<InlayHintKind>>,
pub version: usize,
}
struct CachedExcerptHints {
#[derive(Debug)]
pub struct CachedExcerptHints {
version: usize,
buffer_version: Global,
hints: Vec<(InlayId, InlayHint)>,
pub hints: Vec<(InlayId, InlayHint)>,
}
#[derive(Debug, Clone, Copy)]
@ -91,6 +93,10 @@ impl InlayHintCache {
}
}
pub fn snapshot(&self) -> &CacheSnapshot {
&self.snapshot
}
pub fn update_settings(
&mut self,
multi_buffer: &ModelHandle<MultiBuffer>,