From e97cd709cd91ccfafbd45bab8b2bf01f3ddf6a04 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Mon, 15 Mar 2021 17:43:46 +0100 Subject: Implement Crate::transitive_reverse_dependencies --- crates/ide/src/references.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'crates/ide') diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index ec7c7686d..fc85cd0ce 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -1270,4 +1270,27 @@ fn foo(_: bool) -> bo$0ol { true } "#]], ); } + + #[test] + fn test_transitive() { + check( + r#" +//- /level3/level3.rs crate:level3 +pub struct Fo$0o; +//- /level2/level2.rs crate:level2 deps:level3 +pub use level3::Foo; +//- /level1/level1.rs crate:level1 deps:level2 +pub use level2::Foo; +//- /level0/level0.rs crate:level0 deps:level1 +pub use level1::Foo; +"#, + expect![[r#" + Foo Struct FileId(0) 0..15 11..14 + + FileId(1) 16..19 + FileId(2) 16..19 + FileId(3) 16..19 + "#]], + ); + } } -- cgit v1.2.3 From 75fafd6fcc010c71d770d19bea4b744b92c5267b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 16 Mar 2021 15:28:02 +0100 Subject: Add new_source_root meta to test fixtures --- crates/ide/src/references.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/references.rs b/crates/ide/src/references.rs index fc85cd0ce..e10a3ccf7 100644 --- a/crates/ide/src/references.rs +++ b/crates/ide/src/references.rs @@ -1275,13 +1275,13 @@ fn foo(_: bool) -> bo$0ol { true } fn test_transitive() { check( r#" -//- /level3/level3.rs crate:level3 +//- /level3.rs new_source_root: crate:level3 pub struct Fo$0o; -//- /level2/level2.rs crate:level2 deps:level3 +//- /level2.rs new_source_root: crate:level2 deps:level3 pub use level3::Foo; -//- /level1/level1.rs crate:level1 deps:level2 +//- /level1.rs new_source_root: crate:level1 deps:level2 pub use level2::Foo; -//- /level0/level0.rs crate:level0 deps:level1 +//- /level0.rs new_source_root: crate:level0 deps:level1 pub use level1::Foo; "#, expect![[r#" -- cgit v1.2.3