fix: doc url link type

This commit is contained in:
rainy-me 2022-05-05 00:41:29 +09:00
parent 0ee4e6a22d
commit 5f4351fbb6
4 changed files with 82 additions and 33 deletions

View file

@ -3641,6 +3641,40 @@ mod return_keyword {}
);
}
#[test]
fn hover_keyword_doc() {
check(
r#"
//- /main.rs crate:main deps:std
fn foo() {
let bar = mov$0e || {};
}
//- /libstd.rs crate:std
#[doc(keyword = "move")]
/// [closure]
/// [closures][closure]
/// [threads]
///
/// [closure]: ../book/ch13-01-closures.html
/// [threads]: ../book/ch16-01-threads.html#using-move-closures-with-threads
mod move_keyword {}
"#,
expect![[r##"
*move*
```rust
move
```
---
[closure](https://doc.rust-lang.org/nightly/book/ch13-01-closures.html)
[closures](https://doc.rust-lang.org/nightly/book/ch13-01-closures.html)
[threads](https://doc.rust-lang.org/nightly/book/ch16-01-threads.html#using-move-closures-with-threads)
"##]],
);
}
#[test]
fn hover_keyword_as_primitive() {
check(