mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Make hover test not relient on minicore structure
This commit is contained in:
parent
5360c9bd22
commit
85ed5a3182
1 changed files with 39 additions and 32 deletions
|
@ -2361,46 +2361,53 @@ fn foo(ar$0g: &impl Foo + Bar<S>) {}
|
||||||
fn test_hover_async_block_impl_trait_has_goto_type_action() {
|
fn test_hover_async_block_impl_trait_has_goto_type_action() {
|
||||||
check_actions(
|
check_actions(
|
||||||
r#"
|
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;
|
struct S;
|
||||||
fn foo() {
|
fn foo() {
|
||||||
let fo$0o = async { S };
|
let fo$0o = async { S };
|
||||||
}
|
}
|
||||||
|
//- /core.rs crate:core
|
||||||
|
pub mod future {
|
||||||
|
#[lang = "future_trait"]
|
||||||
|
pub trait Future {}
|
||||||
|
}
|
||||||
"#,
|
"#,
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
[
|
[
|
||||||
GoToType(
|
GoToType(
|
||||||
[
|
[
|
||||||
HoverGotoTypeData {
|
HoverGotoTypeData {
|
||||||
mod_path: "core::future::Future",
|
mod_path: "core::future::Future",
|
||||||
nav: NavigationTarget {
|
nav: NavigationTarget {
|
||||||
file_id: FileId(
|
file_id: FileId(
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
full_range: 276..458,
|
full_range: 21..69,
|
||||||
focus_range: 315..321,
|
focus_range: 60..66,
|
||||||
name: "Future",
|
name: "Future",
|
||||||
kind: Trait,
|
kind: Trait,
|
||||||
description: "pub trait Future",
|
description: "pub trait Future",
|
||||||
},
|
|
||||||
},
|
},
|
||||||
HoverGotoTypeData {
|
},
|
||||||
mod_path: "test::S",
|
HoverGotoTypeData {
|
||||||
nav: NavigationTarget {
|
mod_path: "main::S",
|
||||||
file_id: FileId(
|
nav: NavigationTarget {
|
||||||
0,
|
file_id: FileId(
|
||||||
),
|
0,
|
||||||
full_range: 0..9,
|
),
|
||||||
focus_range: 7..8,
|
full_range: 0..110,
|
||||||
name: "S",
|
focus_range: 108..109,
|
||||||
kind: Struct,
|
name: "S",
|
||||||
description: "struct S",
|
kind: Struct,
|
||||||
},
|
description: "struct S",
|
||||||
},
|
},
|
||||||
],
|
},
|
||||||
),
|
],
|
||||||
]
|
),
|
||||||
"#]],
|
]
|
||||||
|
"#]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue