From c766492d2625dba65c3bd933841c71938f6dc747 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 16 Mar 2021 21:05:07 +0100 Subject: Properly handle doc attributes in doc-comment highlight injection --- .../test_data/highlight_doctest.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'crates/ide/src/syntax_highlighting/test_data') diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index 5e877df88..45817faf9 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -105,4 +105,20 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd ($expr:expr) => { $expr } -} \ No newline at end of file +} + +/// ```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() {} \ No newline at end of file -- cgit v1.2.3