From 3a2c92aa4afad493123e809674d9fa77fb01d247 Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Tue, 21 Oct 2025 17:15:07 -0300 Subject: [PATCH] Add cursor marker --- crates/zeta2_tools/src/zeta2_tools.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/crates/zeta2_tools/src/zeta2_tools.rs b/crates/zeta2_tools/src/zeta2_tools.rs index 844d1abe4a8c98b81184358ac069e29a2682c3da..00a9a78ad69584a91050ad5e7855c94823080830 100644 --- a/crates/zeta2_tools/src/zeta2_tools.rs +++ b/crates/zeta2_tools/src/zeta2_tools.rs @@ -1,6 +1,6 @@ use std::{ - cmp::Reverse, collections::hash_map::Entry, ops::Add as _, path::PathBuf, str::FromStr, - sync::Arc, time::Duration, + cmp::Reverse, collections::hash_map::Entry, fmt::Debug, ops::Add as _, path::PathBuf, + str::FromStr, sync::Arc, time::Duration, }; use client::{Client, UserStore}; @@ -400,6 +400,14 @@ impl Zeta2Inspector { buffer.set_language(language.clone(), cx); } buffer.file_updated(excerpt_file, cx); + #[cfg(debug_assertions)] + buffer.debug( + &language::Point::new( + request.full_request.cursor_point.line.0, + request.full_request.cursor_point.column, + ), + CursorMarker, + ); buffer }); @@ -1212,6 +1220,16 @@ impl language::File for ExcerptMetadataFile { } } +#[cfg(debug_assertions)] +struct CursorMarker; + +#[cfg(debug_assertions)] +impl Debug for CursorMarker { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "Cursor") + } +} + struct ZetaContextAddon { excerpt_score_components: HashMap, }