diff --git a/crates/editor/src/inlays/inlay_hints.rs b/crates/editor/src/inlays/inlay_hints.rs index 3aab7be8207ef09b9ae18140cbfcd749eb9bc0d1..2cbea33932d8f6f2c9924036dd60bb2ef68044dc 100644 --- a/crates/editor/src/inlays/inlay_hints.rs +++ b/crates/editor/src/inlays/inlay_hints.rs @@ -344,7 +344,7 @@ impl Editor { .extend(invalidate_hints_for_buffers); let mut buffers_to_query = HashMap::default(); - for (excerpt_id, (buffer, buffer_version, visible_range)) in visible_excerpts { + for (_, (buffer, buffer_version, visible_range)) in visible_excerpts { let buffer_id = buffer.read(cx).remote_id(); if !self.registered_buffers.contains_key(&buffer_id) { continue; @@ -358,13 +358,11 @@ impl Editor { buffers_to_query .entry(buffer_id) .or_insert_with(|| VisibleExcerpts { - excerpts: Vec::new(), ranges: Vec::new(), buffer_version: buffer_version.clone(), buffer: buffer.clone(), }); visible_excerpts.buffer_version = buffer_version; - visible_excerpts.excerpts.push(excerpt_id); visible_excerpts.ranges.push(buffer_anchor_range); } @@ -850,7 +848,6 @@ impl Editor { #[derive(Debug)] struct VisibleExcerpts { - excerpts: Vec, ranges: Vec>, buffer_version: Global, buffer: Entity, @@ -2017,7 +2014,7 @@ pub mod tests { task_lsp_request_ranges.lock().push(params.range); task_lsp_request_count.fetch_add(1, Ordering::Release); Ok(Some(vec![lsp::InlayHint { - position: params.range.end, + position: params.range.start, label: lsp::InlayHintLabel::String( params.range.end.line.to_string(), ), diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index faf53fa802c858822c20635f4ebb906cbdd4b886..139ac25fe781a97ee448ebc83034538c19a56aa6 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -6844,7 +6844,7 @@ impl LspStore { && range.start.is_valid(&buffer_snapshot) && range.end.is_valid(&buffer_snapshot) && hint.position.cmp(&range.start, &buffer_snapshot).is_ge() - && hint.position.cmp(&range.end, &buffer_snapshot).is_le() + && hint.position.cmp(&range.end, &buffer_snapshot).is_lt() }); (server_id, new_hints) })