diff options
Diffstat (limited to 'xtask/src')
-rw-r--r-- | xtask/src/codegen.rs | 6 | ||||
-rw-r--r-- | xtask/src/codegen/gen_assists_docs.rs | 11 | ||||
-rw-r--r-- | xtask/src/lib.rs | 2 | ||||
-rw-r--r-- | xtask/src/main.rs | 1 |
4 files changed, 13 insertions, 7 deletions
diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index 5511c01d5..f5f4b964a 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs | |||
@@ -18,8 +18,10 @@ use std::{ | |||
18 | use crate::{not_bash::fs2, project_root, Result}; | 18 | use crate::{not_bash::fs2, project_root, Result}; |
19 | 19 | ||
20 | pub use self::{ | 20 | pub use self::{ |
21 | gen_assists_docs::generate_assists_docs, gen_feature_docs::generate_feature_docs, | 21 | gen_assists_docs::{generate_assists_docs, generate_assists_tests}, |
22 | gen_parser_tests::generate_parser_tests, gen_syntax::generate_syntax, | 22 | gen_feature_docs::generate_feature_docs, |
23 | gen_parser_tests::generate_parser_tests, | ||
24 | gen_syntax::generate_syntax, | ||
23 | }; | 25 | }; |
24 | 26 | ||
25 | const GRAMMAR_DIR: &str = "crates/ra_parser/src/grammar"; | 27 | const GRAMMAR_DIR: &str = "crates/ra_parser/src/grammar"; |
diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 6c1be5350..526941f73 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs | |||
@@ -7,16 +7,17 @@ use crate::{ | |||
7 | project_root, rust_files, Result, | 7 | project_root, rust_files, Result, |
8 | }; | 8 | }; |
9 | 9 | ||
10 | pub fn generate_assists_docs(mode: Mode) -> Result<()> { | 10 | pub fn generate_assists_tests(mode: Mode) -> Result<()> { |
11 | let assists = Assist::collect()?; | 11 | let assists = Assist::collect()?; |
12 | generate_tests(&assists, mode)?; | 12 | generate_tests(&assists, mode) |
13 | } | ||
13 | 14 | ||
15 | pub fn generate_assists_docs(mode: Mode) -> Result<()> { | ||
16 | let assists = Assist::collect()?; | ||
14 | let contents = assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"); | 17 | let contents = assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"); |
15 | let contents = contents.trim().to_string() + "\n"; | 18 | let contents = contents.trim().to_string() + "\n"; |
16 | let dst = project_root().join("docs/user/generated_assists.adoc"); | 19 | let dst = project_root().join("docs/user/generated_assists.adoc"); |
17 | codegen::update(&dst, &contents, mode)?; | 20 | codegen::update(&dst, &contents, mode) |
18 | |||
19 | Ok(()) | ||
20 | } | 21 | } |
21 | 22 | ||
22 | #[derive(Debug)] | 23 | #[derive(Debug)] |
diff --git a/xtask/src/lib.rs b/xtask/src/lib.rs index 874957885..739f49f7b 100644 --- a/xtask/src/lib.rs +++ b/xtask/src/lib.rs | |||
@@ -160,6 +160,8 @@ pub fn run_release(dry_run: bool) -> Result<()> { | |||
160 | run!("git reset --hard tags/nightly")?; | 160 | run!("git reset --hard tags/nightly")?; |
161 | run!("git push")?; | 161 | run!("git push")?; |
162 | } | 162 | } |
163 | codegen::generate_assists_docs(Mode::Overwrite)?; | ||
164 | codegen::generate_feature_docs(Mode::Overwrite)?; | ||
163 | 165 | ||
164 | let website_root = project_root().join("../rust-analyzer.github.io"); | 166 | let website_root = project_root().join("../rust-analyzer.github.io"); |
165 | let changelog_dir = website_root.join("./thisweek/_posts"); | 167 | let changelog_dir = website_root.join("./thisweek/_posts"); |
diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 9d7cdd114..81bb3a33f 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs | |||
@@ -74,6 +74,7 @@ FLAGS: | |||
74 | args.finish()?; | 74 | args.finish()?; |
75 | codegen::generate_syntax(Mode::Overwrite)?; | 75 | codegen::generate_syntax(Mode::Overwrite)?; |
76 | codegen::generate_parser_tests(Mode::Overwrite)?; | 76 | codegen::generate_parser_tests(Mode::Overwrite)?; |
77 | codegen::generate_assists_tests(Mode::Overwrite)?; | ||
77 | codegen::generate_assists_docs(Mode::Overwrite)?; | 78 | codegen::generate_assists_docs(Mode::Overwrite)?; |
78 | codegen::generate_feature_docs(Mode::Overwrite)?; | 79 | codegen::generate_feature_docs(Mode::Overwrite)?; |
79 | Ok(()) | 80 | Ok(()) |