Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 30c5546

Browse files
author
Hendrik van Antwerpen
committed
Update changelog
1 parent 3aefe52 commit 30c5546

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

tree-sitter-stack-graphs/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## Unreleased
9+
10+
### Library
11+
12+
#### Added
13+
14+
- A new `CancelAfterDuration` implementation of `CancellationFlag` that cancels the computation after a certain amount of time.
15+
16+
### CLI
17+
18+
#### Added
19+
20+
- A new `analyze` command that computes stack graphs and partial paths for all given source files and directories. The command does not produce any output at the moment. Analysis per file can be limited using the `--max-file-time` flag.
21+
822
## v0.6.0 -- 2023-01-13
923

1024
### Library

tree-sitter-stack-graphs/src/cli/analyze.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// ------------------------------------------------------------------------------------------------
77

88
use anyhow::anyhow;
9-
use anyhow::Context as _;
109
use clap::Args;
1110
use clap::ValueHint;
1211
use colored::Colorize as _;
@@ -93,8 +92,14 @@ impl AnalyzeArgs {
9392
source_path: &Path,
9493
loader: &mut Loader,
9594
) -> anyhow::Result<()> {
96-
self.analyze_file(source_root, source_path, loader)
97-
.with_context(|| format!("Error analyzing file {}", source_path.display()))
95+
let result = self.analyze_file(source_root, source_path, loader);
96+
if result.is_err() {
97+
if !self.verbose {
98+
eprint!("{}: ", source_path.display());
99+
}
100+
eprintln!("{}", "error".red());
101+
}
102+
result
98103
}
99104

100105
fn analyze_file(
@@ -121,7 +126,10 @@ impl AnalyzeArgs {
121126
);
122127
return Ok(());
123128
}
124-
Err(e) => return Err(e.into()),
129+
Err(e) => {
130+
eprint!("{}: ", source_path.display());
131+
return Err(e.into());
132+
}
125133
};
126134

127135
if self.verbose {

0 commit comments

Comments
 (0)