Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ lsp = { package = "lisette-lsp", version = "0.4.3", path = "../lsp" }
tokio = { version = "1", features = ["rt-multi-thread", "io-std"] }
tower-lsp = "0.20"
fs2 = "0.4"
terminal_size = "0.4"
owo-colors.workspace = true
rustc-hash.workspace = true
serde.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/handlers/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ fn setup_project(
return Err(1);
}

print_preview_notice();
print_preview_notice("Third-party Go dependencies", true);

let project_target_dir = project_root.join("target");
if project_target_dir.is_file() {
Expand Down
38 changes: 19 additions & 19 deletions crates/cli/src/handlers/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,6 @@ pub(super) fn build_locked(prep: &BuildPrep, options: BuildOptions) -> BuildOutc

let project_name = go_module_name.rsplit('/').next().unwrap_or(go_module_name);

if !quiet {
eprintln!();
if crate::output::use_color() {
use owo_colors::OwoColorize;
eprintln!(
" · Compiling {} v{}",
project_name.bright_magenta(),
version
);
} else {
eprintln!(" · Compiling `{}` v{}", project_name, version);
}
}

let compile_config = CompileConfig {
target_phase: CompilePhase::Emit,
go_module: go_module_name.to_string(),
Expand Down Expand Up @@ -419,11 +405,25 @@ pub(super) fn build_locked(prep: &BuildPrep, options: BuildOptions) -> BuildOutc
go_cli::write_emit_manifest(&prep.target_dir, &emit.new_manifest);

if !quiet {
eprintln!(
" ✓ {} {}",
label,
crate::output::format_elapsed(start.elapsed())
);
eprintln!();
if crate::output::use_color() {
use owo_colors::OwoColorize;
eprintln!(
" ✓ {} {} v{} {}",
label,
project_name.bright_magenta(),
version,
crate::output::format_elapsed(start.elapsed())
);
} else {
eprintln!(
" ✓ {} `{}` v{} {}",
label,
project_name,
version,
crate::output::format_elapsed(start.elapsed())
);
}
}

BuildOutcome {
Expand Down
12 changes: 8 additions & 4 deletions crates/cli/src/handlers/test/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::time::Instant;
use std::time::Duration;

use crate::cli_error;
use crate::go_cli;
Expand All @@ -12,7 +12,7 @@ mod report;
use report::{build_report_filtered, exit_code, matching_tests, render};

pub fn test(path: Option<String>, go_flags: Vec<String>, filter: Option<String>) -> i32 {
crate::output::print_test_unfinished_notice();
crate::output::print_preview_notice("Test runner", false);
with_locked_project(path, |prep| {
let outcome = build_locked(
prep,
Expand Down Expand Up @@ -61,7 +61,6 @@ pub fn test(path: Option<String>, go_flags: Vec<String>, filter: Option<String>)
}
};

let started = Instant::now();
let run = match go_cli::run_tests(
&build_dir,
stdlib::Target::host(),
Expand All @@ -83,7 +82,12 @@ pub fn test(path: Option<String>, go_flags: Vec<String>, filter: Option<String>)
);
eprint!(
"{}",
render(&report, &outcome.sources, use_color(), started.elapsed())
render(
&report,
&outcome.sources,
use_color(),
Duration::from_secs_f64(report.test_elapsed),
)
);

let build_error = report.build_output.trim();
Expand Down
Loading
Loading