mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-03 21:25:25 +00:00
add doc link test for goto def
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
This commit is contained in:
parent
778322eb31
commit
318185720c
1 changed files with 68 additions and 0 deletions
|
|
@ -1922,6 +1922,74 @@ pub fn foo() { }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn goto_def_for_intra_doc_link_outer_same_file() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
/// [`S$0`]
|
||||||
|
mod m {
|
||||||
|
//! [`super::S`]
|
||||||
|
}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
/// [`S$0`]
|
||||||
|
mod m {}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
/// [`S$0`]
|
||||||
|
fn f() {
|
||||||
|
//! [`S`]
|
||||||
|
}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn goto_def_for_intra_doc_link_inner_same_file() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
/// [`S`]
|
||||||
|
mod m {
|
||||||
|
//! [`super::S$0`]
|
||||||
|
}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
mod m {
|
||||||
|
//! [`super::S$0`]
|
||||||
|
}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
fn f() {
|
||||||
|
//! [`S$0`]
|
||||||
|
}
|
||||||
|
struct S;
|
||||||
|
//^
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn goto_def_for_intra_doc_link_inner() {
|
fn goto_def_for_intra_doc_link_inner() {
|
||||||
check(
|
check(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue