Make hover test not relient on minicore structure

This commit is contained in:
Lukas Wirth 2021-12-22 02:36:31 +01:00
parent 5360c9bd22
commit 85ed5a3182

View file

@ -2361,11 +2361,18 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
fn test_hover_async_block_impl_trait_has_goto_type_action() {
check_actions(
r#"
//- minicore: future
//- /main.rs crate:main deps:core
// we don't use minicore here so that this test doesn't randomly fail
// when someone edits minicore
struct S;
fn foo() {
let fo$0o = async { S };
}
//- /core.rs crate:core
pub mod future {
#[lang = "future_trait"]
pub trait Future {}
}
"#,
expect![[r#"
[
@ -2377,21 +2384,21 @@ fn foo() {
file_id: FileId(
1,
),
full_range: 276..458,
focus_range: 315..321,
full_range: 21..69,
focus_range: 60..66,
name: "Future",
kind: Trait,
description: "pub trait Future",
},
},
HoverGotoTypeData {
mod_path: "test::S",
mod_path: "main::S",
nav: NavigationTarget {
file_id: FileId(
0,
),
full_range: 0..9,
focus_range: 7..8,
full_range: 0..110,
focus_range: 108..109,
name: "S",
kind: Struct,
description: "struct S",