Skip to content

Commit ca46465

Browse files
committed
Add a test to document unimplemented case
1 parent 4f5f608 commit ca46465

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

crates/ra_ide/src/hover.rs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,36 @@ fn foo() { let bar = Ba<|>r; }
13571357
);
13581358
}
13591359

1360+
#[ignore = "path based links currently only support documentation on ModuleDef items"]
1361+
#[test]
1362+
fn test_hover_path_link_field() {
1363+
check(
1364+
r"
1365+
//- /lib.rs
1366+
pub struct Foo;
1367+
pub struct Bar {
1368+
/// [Foo](struct.Foo.html)
1369+
fie<|>ld: ()
1370+
}
1371+
",
1372+
expect![[r#"
1373+
*field*
1374+
1375+
```rust
1376+
test::Bar
1377+
```
1378+
1379+
```rust
1380+
field: ()
1381+
```
1382+
1383+
---
1384+
1385+
[Foo](https://docs.rs/test/*/test/struct.Foo.html)
1386+
"#]],
1387+
);
1388+
}
1389+
13601390
#[test]
13611391
fn test_hover_intra_link() {
13621392
check(
@@ -1386,6 +1416,38 @@ fn foo() { let bar = Ba<|>r; }
13861416
);
13871417
}
13881418

1419+
#[test]
1420+
fn test_hover_intra_link_html_root_url() {
1421+
check(
1422+
r#"
1423+
//- /lib.rs
1424+
1425+
#![doc(arbitrary_attribute = "test", html_root_url = "https:/example.com", arbitrary_attribute2)]
1426+
1427+
pub mod foo {
1428+
pub struct Foo;
1429+
}
1430+
/// [Foo](foo::Foo)
1431+
pub struct B<|>ar
1432+
"#,
1433+
expect![[r#"
1434+
*Bar*
1435+
1436+
```rust
1437+
test
1438+
```
1439+
1440+
```rust
1441+
pub struct Bar
1442+
```
1443+
1444+
---
1445+
1446+
[Foo](https://example.com/test/foo/struct.Foo.html)
1447+
"#]],
1448+
);
1449+
}
1450+
13891451
#[test]
13901452
fn test_hover_intra_link_shortlink() {
13911453
check(

0 commit comments

Comments
 (0)