diff options
Diffstat (limited to 'xtask/src/codegen/gen_assists_docs.rs')
-rw-r--r-- | xtask/src/codegen/gen_assists_docs.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 654ae09d6..e313820d1 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use std::{fs, path::Path}; | 1 | use std::{fs, path::Path}; |
2 | 2 | ||
3 | use crate::{ | 3 | use crate::{ |
4 | codegen::{self, extract_comment_blocks, Mode}, | 4 | codegen::{self, extract_comment_blocks_with_empty_lines, Mode}, |
5 | project_root, Result, | 5 | project_root, Result, |
6 | }; | 6 | }; |
7 | 7 | ||
@@ -34,7 +34,7 @@ fn collect_assists() -> Result<Vec<Assist>> { | |||
34 | 34 | ||
35 | fn collect_file(acc: &mut Vec<Assist>, path: &Path) -> Result<()> { | 35 | fn collect_file(acc: &mut Vec<Assist>, path: &Path) -> Result<()> { |
36 | let text = fs::read_to_string(path)?; | 36 | let text = fs::read_to_string(path)?; |
37 | let comment_blocks = extract_comment_blocks(&text); | 37 | let comment_blocks = extract_comment_blocks_with_empty_lines(&text); |
38 | 38 | ||
39 | for block in comment_blocks { | 39 | for block in comment_blocks { |
40 | // FIXME: doesn't support blank lines yet, need to tweak | 40 | // FIXME: doesn't support blank lines yet, need to tweak |
@@ -45,7 +45,11 @@ fn collect_assists() -> Result<Vec<Assist>> { | |||
45 | continue; | 45 | continue; |
46 | } | 46 | } |
47 | let id = first_line["Assist: ".len()..].to_string(); | 47 | let id = first_line["Assist: ".len()..].to_string(); |
48 | assert!(id.chars().all(|it| it.is_ascii_lowercase() || it == '_')); | 48 | assert!( |
49 | id.chars().all(|it| it.is_ascii_lowercase() || it == '_'), | ||
50 | "invalid assist id: {:?}", | ||
51 | id | ||
52 | ); | ||
49 | 53 | ||
50 | let doc = take_until(lines.by_ref(), "```"); | 54 | let doc = take_until(lines.by_ref(), "```"); |
51 | let before = take_until(lines.by_ref(), "```"); | 55 | let before = take_until(lines.by_ref(), "```"); |