diff options
| author | Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> | 2025-05-07 00:36:42 +0900 |
|---|---|---|
| committer | Hayashi Mikihiro <34ttrweoewiwe28@gmail.com> | 2025-05-07 00:36:42 +0900 |
| commit | ecb59e185a8c7170bd77ea7161bd7881be64e5ec (patch) | |
| tree | 5736663f126beec5d39f4f6e84fcbc24f6d678c8 /src/tools/rust-analyzer/crates | |
| parent | 8935d0bdeae3e5165928ebcb31adf7fd5e2a1355 (diff) | |
| download | rust-ecb59e185a8c7170bd77ea7161bd7881be64e5ec.tar.gz rust-ecb59e185a8c7170bd77ea7161bd7881be64e5ec.zip | |
add doc link test for goto def
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
Diffstat (limited to 'src/tools/rust-analyzer/crates')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide/src/goto_definition.rs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs index b894e857522..c60ca3562f6 100644 --- a/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs +++ b/src/tools/rust-analyzer/crates/ide/src/goto_definition.rs @@ -1923,6 +1923,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] fn goto_def_for_intra_doc_link_inner() { check( r#" |
