aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src')
-rw-r--r--crates/ide/src/syntax_highlighting/inject.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/inject.rs b/crates/ide/src/syntax_highlighting/inject.rs
index 855c7fba8..6b1037870 100644
--- a/crates/ide/src/syntax_highlighting/inject.rs
+++ b/crates/ide/src/syntax_highlighting/inject.rs
@@ -85,6 +85,8 @@ const RUSTDOC_FENCE_TOKENS: &[&'static str] = &[
85 "ignore", 85 "ignore",
86 "no_run", 86 "no_run",
87 "compile_fail", 87 "compile_fail",
88 "allow_fail",
89 "test_harness",
88 "edition2015", 90 "edition2015",
89 "edition2018", 91 "edition2018",
90 "edition2021", 92 "edition2021",
@@ -181,7 +183,7 @@ pub(super) fn doc_comment(
181 is_codeblock = !is_codeblock; 183 is_codeblock = !is_codeblock;
182 // Check whether code is rust by inspecting fence guards 184 // Check whether code is rust by inspecting fence guards
183 let guards = &line[idx + RUSTDOC_FENCE.len()..]; 185 let guards = &line[idx + RUSTDOC_FENCE.len()..];
184 let is_rust = guards.split(',').all(|sub| is_rustdoc_fence_token(sub.trim())); 186 let is_rust = guards.split(',').any(|sub| is_rustdoc_fence_token(sub.trim()));
185 is_doctest = is_codeblock && is_rust; 187 is_doctest = is_codeblock && is_rust;
186 continue; 188 continue;
187 } 189 }