mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Simplify xtask
lib/bin/test separation isn't really needed.
This commit is contained in:
parent
c17f2bf2a2
commit
d9dcfd81c5
17 changed files with 167 additions and 180 deletions
|
@ -7,12 +7,12 @@ use crate::{
|
|||
project_root, rust_files_in, Result,
|
||||
};
|
||||
|
||||
pub fn generate_assists_tests(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_assists_tests(mode: Mode) -> Result<()> {
|
||||
let assists = Assist::collect()?;
|
||||
generate_tests(&assists, mode)
|
||||
}
|
||||
|
||||
pub fn generate_assists_docs(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_assists_docs(mode: Mode) -> Result<()> {
|
||||
let assists = Assist::collect()?;
|
||||
let contents = assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
|
||||
let contents = format!("//{}\n{}\n", PREAMBLE, contents.trim());
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
project_root, rust_files, Result,
|
||||
};
|
||||
|
||||
pub fn generate_diagnostic_docs(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_diagnostic_docs(mode: Mode) -> Result<()> {
|
||||
let diagnostics = Diagnostic::collect()?;
|
||||
let contents =
|
||||
diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::{
|
|||
project_root, rust_files, Result,
|
||||
};
|
||||
|
||||
pub fn generate_feature_docs(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_feature_docs(mode: Mode) -> Result<()> {
|
||||
let features = Feature::collect()?;
|
||||
let contents = features.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
|
||||
let contents = format!("//{}\n{}\n", PREAMBLE, contents.trim());
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::{
|
|||
run_rustfmt,
|
||||
};
|
||||
|
||||
pub fn generate_lint_completions(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_lint_completions(mode: Mode) -> Result<()> {
|
||||
if !Path::new("./target/rust").exists() {
|
||||
cmd!("git clone --depth=1 https://github.com/rust-lang/rust ./target/rust").run()?;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::{
|
|||
project_root, Result,
|
||||
};
|
||||
|
||||
pub fn generate_parser_tests(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_parser_tests(mode: Mode) -> Result<()> {
|
||||
let tests = tests_from_dir(&project_root().join(Path::new("crates/parser/src/grammar")))?;
|
||||
fn install_tests(tests: &HashMap<String, Test>, into: &str, mode: Mode) -> Result<()> {
|
||||
let tests_dir = project_root().join(into);
|
||||
|
|
|
@ -18,7 +18,7 @@ use crate::{
|
|||
project_root, Result,
|
||||
};
|
||||
|
||||
pub fn generate_syntax(mode: Mode) -> Result<()> {
|
||||
pub(crate) fn generate_syntax(mode: Mode) -> Result<()> {
|
||||
let grammar = rust_grammar();
|
||||
let ast = lower(&grammar);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue