mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Properly handle doc attributes in doc-comment highlight injection
This commit is contained in:
parent
3daa302cd3
commit
c766492d26
5 changed files with 84 additions and 8 deletions
|
@ -541,6 +541,22 @@ macro_rules! noop {
|
|||
$expr
|
||||
}
|
||||
}
|
||||
|
||||
/// ```rust
|
||||
/// let _ = example(&[1, 2, 3]);
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
/// loop {}
|
||||
#[cfg_attr(not(feature = "false"), doc = "loop {}")]
|
||||
#[doc = "loop {}"]
|
||||
/// ```
|
||||
///
|
||||
#[cfg_attr(feature = "alloc", doc = "```rust")]
|
||||
#[cfg_attr(not(feature = "alloc"), doc = "```ignore")]
|
||||
/// let _ = example(&alloc::vec![1, 2, 3]);
|
||||
/// ```
|
||||
pub fn mix_and_match() {}
|
||||
"#
|
||||
.trim(),
|
||||
expect_file!["./test_data/highlight_doctest.html"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue