diff --git a/crates/assists/src/tests.rs b/crates/assists/src/tests.rs index 32bd8698b1f..b27f6bf7530 100644 --- a/crates/assists/src/tests.rs +++ b/crates/assists/src/tests.rs @@ -49,14 +49,17 @@ pub(crate) fn check_assist_by_label( // FIXME: instead of having a separate function here, maybe use // `extract_ranges` and mark the target as ` ` in the // fixture? +#[track_caller] pub(crate) fn check_assist_target(assist: Handler, ra_fixture: &str, target: &str) { check(assist, ra_fixture, ExpectedResult::Target(target), None); } +#[track_caller] pub(crate) fn check_assist_not_applicable(assist: Handler, ra_fixture: &str) { check(assist, ra_fixture, ExpectedResult::NotApplicable, None); } +#[track_caller] fn check_doc_test(assist_id: &str, before: &str, after: &str) { let after = trim_indent(after); let (db, file_id, selection) = RootDatabase::with_range_or_offset(&before); @@ -95,6 +98,7 @@ enum ExpectedResult<'a> { Target(&'a str), } +#[track_caller] fn check(handler: Handler, before: &str, expected: ExpectedResult, assist_label: Option<&str>) { let (db, file_with_caret_id, range_or_offset) = RootDatabase::with_range_or_offset(before); let text_without_caret = db.file_text(file_with_caret_id).to_string();