mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
Add a test to document unimplemented case
This commit is contained in:
parent
4f5f608b49
commit
ca464650ee
1 changed files with 62 additions and 0 deletions
|
@ -1357,6 +1357,36 @@ fn foo() { let bar = Ba<|>r; }
|
|||
);
|
||||
}
|
||||
|
||||
#[ignore = "path based links currently only support documentation on ModuleDef items"]
|
||||
#[test]
|
||||
fn test_hover_path_link_field() {
|
||||
check(
|
||||
r"
|
||||
//- /lib.rs
|
||||
pub struct Foo;
|
||||
pub struct Bar {
|
||||
/// [Foo](struct.Foo.html)
|
||||
fie<|>ld: ()
|
||||
}
|
||||
",
|
||||
expect![[r#"
|
||||
*field*
|
||||
|
||||
```rust
|
||||
test::Bar
|
||||
```
|
||||
|
||||
```rust
|
||||
field: ()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
[Foo](https://docs.rs/test/*/test/struct.Foo.html)
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_intra_link() {
|
||||
check(
|
||||
|
@ -1386,6 +1416,38 @@ fn foo() { let bar = Ba<|>r; }
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_intra_link_html_root_url() {
|
||||
check(
|
||||
r#"
|
||||
//- /lib.rs
|
||||
|
||||
#![doc(arbitrary_attribute = "test", html_root_url = "https:/example.com", arbitrary_attribute2)]
|
||||
|
||||
pub mod foo {
|
||||
pub struct Foo;
|
||||
}
|
||||
/// [Foo](foo::Foo)
|
||||
pub struct B<|>ar
|
||||
"#,
|
||||
expect![[r#"
|
||||
*Bar*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
pub struct Bar
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
[Foo](https://example.com/test/foo/struct.Foo.html)
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_intra_link_shortlink() {
|
||||
check(
|
||||
|
|
Loading…
Reference in a new issue