From d385438bcc8d302fbcb91114e19ac0cc30528822 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 25 Oct 2019 23:38:15 +0300 Subject: generate more assists docs --- xtask/src/codegen/gen_assists_docs.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xtask/src/codegen') 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 @@ use std::{fs, path::Path}; use crate::{ - codegen::{self, extract_comment_blocks, Mode}, + codegen::{self, extract_comment_blocks_with_empty_lines, Mode}, project_root, Result, }; @@ -34,7 +34,7 @@ fn collect_assists() -> Result> { fn collect_file(acc: &mut Vec, path: &Path) -> Result<()> { let text = fs::read_to_string(path)?; - let comment_blocks = extract_comment_blocks(&text); + let comment_blocks = extract_comment_blocks_with_empty_lines(&text); for block in comment_blocks { // FIXME: doesn't support blank lines yet, need to tweak @@ -45,7 +45,11 @@ fn collect_assists() -> Result> { continue; } let id = first_line["Assist: ".len()..].to_string(); - assert!(id.chars().all(|it| it.is_ascii_lowercase() || it == '_')); + assert!( + id.chars().all(|it| it.is_ascii_lowercase() || it == '_'), + "invalid assist id: {:?}", + id + ); let doc = take_until(lines.by_ref(), "```"); let before = take_until(lines.by_ref(), "```"); -- cgit v1.2.3