File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change @@ -1357,6 +1357,36 @@ fn foo() { let bar = Ba<|>r; }
1357
1357
) ;
1358
1358
}
1359
1359
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
+
1360
1390
#[ test]
1361
1391
fn test_hover_intra_link ( ) {
1362
1392
check (
@@ -1386,6 +1416,38 @@ fn foo() { let bar = Ba<|>r; }
1386
1416
) ;
1387
1417
}
1388
1418
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
+
1389
1451
#[ test]
1390
1452
fn test_hover_intra_link_shortlink ( ) {
1391
1453
check (
You can’t perform that action at this time.
0 commit comments