Add #[track_caller] to test utilities that involve marked text (#32043)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-06-04 02:37:27 +00:00
committed by GitHub
parent 030d4d2631
commit 48eacf3f2a
7 changed files with 12 additions and 0 deletions
@@ -109,6 +109,7 @@ impl EditorTestContext {
}
}
#[track_caller]
pub fn new_multibuffer<const COUNT: usize>(
cx: &mut gpui::TestAppContext,
excerpts: [&str; COUNT],
@@ -351,6 +352,7 @@ impl EditorTestContext {
/// editor state was needed to cause the failure.
///
/// See the `util::test::marked_text_ranges` function for more information.
#[track_caller]
pub fn set_state(&mut self, marked_text: &str) -> ContextHandle {
let state_context = self.add_assertion_context(format!(
"Initial Editor State: \"{}\"",
@@ -367,6 +369,7 @@ impl EditorTestContext {
}
/// Only change the editor's selections
#[track_caller]
pub fn set_selections_state(&mut self, marked_text: &str) -> ContextHandle {
let state_context = self.add_assertion_context(format!(
"Initial Editor State: \"{}\"",