diff options
author | Lukas Wirth <[email protected]> | 2021-03-16 20:05:07 +0000 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-03-16 20:15:26 +0000 |
commit | c766492d2625dba65c3bd933841c71938f6dc747 (patch) | |
tree | 79fc22c7f6018bafa8856fa52494646ebf9781d3 /crates/ide/src/syntax_highlighting/tests.rs | |
parent | 3daa302cd39c779cae0b096972f2fdc3e67e214c (diff) |
Properly handle doc attributes in doc-comment highlight injection
Diffstat (limited to 'crates/ide/src/syntax_highlighting/tests.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/tests.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 9d0cd1af5..a5ef2d29b 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs | |||
@@ -541,6 +541,22 @@ macro_rules! noop { | |||
541 | $expr | 541 | $expr |
542 | } | 542 | } |
543 | } | 543 | } |
544 | |||
545 | /// ```rust | ||
546 | /// let _ = example(&[1, 2, 3]); | ||
547 | /// ``` | ||
548 | /// | ||
549 | /// ``` | ||
550 | /// loop {} | ||
551 | #[cfg_attr(not(feature = "false"), doc = "loop {}")] | ||
552 | #[doc = "loop {}"] | ||
553 | /// ``` | ||
554 | /// | ||
555 | #[cfg_attr(feature = "alloc", doc = "```rust")] | ||
556 | #[cfg_attr(not(feature = "alloc"), doc = "```ignore")] | ||
557 | /// let _ = example(&alloc::vec![1, 2, 3]); | ||
558 | /// ``` | ||
559 | pub fn mix_and_match() {} | ||
544 | "# | 560 | "# |
545 | .trim(), | 561 | .trim(), |
546 | expect_file!["./test_data/highlight_doctest.html"], | 562 | expect_file!["./test_data/highlight_doctest.html"], |