aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-08-05 12:26:52 +0800
committer魏曹先生 <1992414357@qq.com>2026-08-05 12:26:52 +0800
commit08e804e75478953aa656064ac25903858bf5ef64 (patch)
treeb12978bab1edb626cc8f4caebd3328f351722278
parentc513b2bcab17069e45dcdeefe36f789361450240 (diff)
fix(core): write RenderResult::eprintln to stderrHEADmain
Fix the method to use `eprintln!` instead of `println!` when `immediate_output` is enabled, ensuring error output goes to stderr.
-rw-r--r--CHANGELOG.md2
-rw-r--r--mingling_core/src/renderer/render_result.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5104a88..f21cf86 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -95,6 +95,8 @@ None
- If the custom completion is `Suggest::FileCompletion`, the default completion is used instead (since `FileCompletion` cannot be meaningfully merged with subcommand suggestions).
- Concrete entry completions and default subcommand suggestions coexist — e.g., `thanks <tab>` now suggests both the leaf nodes (`bob`, `alice`) and the `thanks` entry's own completion.
+7. **[`core:render`]** Fixed the `RenderResult::eprintln` method to actually write to stderr. Previously, this method shamefully used `println!` (which writes to stdout) when `immediate_output` was enabled, rather than `eprintln!` (which writes to stderr). Yes, you read that right — a method literally named `eprintln` was printing to stdout. Talk about a identity crisis. The output has been corrected to use `eprintln!`, ensuring that error-level render output is properly separated from standard output streams. Whoever wrote that deserves a wet noodle slap — the entire point of an `e`-prefixed method is that it goes to standard _error_, not standard _out_. At least the bug is dead now, and we can all sleep a little easier knowing "error" output goes where error output belongs.
+
#### Optimizations:
1. **[`pathf`]** Added `is_module` field to `AnalyzeItem` and a new constructor `AnalyzeItem::local_module(module, item_name)` which sets `is_module: true`. The `type_mapping_builder` now tracks whether an item is a module: when generating `type_using.rs`, module items produce `use path::to::module::*;` (glob import) instead of the standard `use path::to::TypeName;` direct import. Non-module items continue to use direct imports as before. The internal data structure changed from `Vec<(String, String)>` to `Vec<(String, String, bool)>` to carry the `is_module` flag through the pipeline.
diff --git a/mingling_core/src/renderer/render_result.rs b/mingling_core/src/renderer/render_result.rs
index fc3f2b1..3e63a00 100644
--- a/mingling_core/src/renderer/render_result.rs
+++ b/mingling_core/src/renderer/render_result.rs
@@ -350,7 +350,7 @@ impl RenderResult {
pub fn eprintln(&mut self, text: impl Into<String>) {
let text = text.into();
if self.immediate_output {
- println!("{}", text)
+ eprintln!("{}", text)
}
self.append_line_to_buffer(text, Stderr);
}