mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Tease apart orthogonal concerns in markdown link rewriting
`hir` should know nothing about URLs, markdown and html. It should only be able to: * resolve stringy path from documentation * generate canonical stringy path for a def In contrast, link rewriting should not care about semantics of paths and names resolution, and should be concern only with text mangling bits.
This commit is contained in:
parent
3d6c4c143b
commit
f8a59adf5e
9 changed files with 297 additions and 337 deletions
|
@ -1755,6 +1755,60 @@ pub struct B<|>ar
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_links_enum_variant() {
|
||||
check(
|
||||
r#"
|
||||
enum E {
|
||||
/// [E]
|
||||
V<|> { field: i32 }
|
||||
}
|
||||
"#,
|
||||
expect
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_doc_links_field() {
|
||||
check(
|
||||
r#"
|
||||
struct S {
|
||||
/// [`S`]
|
||||
field<|>: i32
|
||||
}
|
||||
"#,
|
||||
expect
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_hover_macro_generated_struct_fn_doc_comment() {
|
||||
mark::check!(hover_macro_generated_struct_fn_doc_comment);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue