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

Commit 328942b

Browse files
author
Hendrik van Antwerpen
authored
Merge pull request #419 from github/skip-files-failing-tsg
Skip failed files during indexing instead of aborting the whole index operation
2 parents a8c7109 + 7db914c commit 328942b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tree-sitter-stack-graphs/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ 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+
## v0.8.2 -- unreleased
9+
10+
### CLI
11+
12+
#### Changed
13+
14+
- Failure to index a file will not abort indexing anymore, but simply mark the file as failed, as we already do for files with parse errors.
15+
816
## v0.8.1 -- 2024-03-06
917

1018
The `stack-graphs` dependency was updated to `v0.13` to fix the build problems of the `v0.8.0` release.

tree-sitter-stack-graphs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tree-sitter-stack-graphs"
3-
version = "0.8.1"
3+
version = "0.8.2"
44
description = "Create stack graphs using tree-sitter parsers"
55
homepage = "https://github.com/github/stack-graphs/tree/main/tree-sitter-stack-graphs"
66
repository = "https://github.com/github/stack-graphs/"

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

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -355,23 +355,15 @@ impl<'a> Indexer<'a> {
355355
if let Err(err) = result {
356356
match err.inner {
357357
BuildError::Cancelled(_) => {
358-
file_status.warning("parsing timed out", None);
358+
file_status.warning("timed out", None);
359359
self.db
360-
.store_error_for_file(source_path, &tag, "parsing timed out")?;
361-
return Ok(());
362-
}
363-
BuildError::ParseErrors { .. } => {
364-
file_status.failure("parsing failed", Some(&err.display_pretty()));
365-
self.db.store_error_for_file(
366-
source_path,
367-
&tag,
368-
&format!("parsing failed: {}", err.inner),
369-
)?;
360+
.store_error_for_file(source_path, &tag, "timed out")?;
370361
return Ok(());
371362
}
372363
_ => {
373-
file_status.failure("failed to build stack graph", Some(&err.display_pretty()));
374-
return Err(IndexError::StackGraph);
364+
file_status.failure("failed", Some(&err.display_pretty()));
365+
self.db.store_error_for_file(source_path, &tag, "failed")?;
366+
return Ok(());
375367
}
376368
}
377369
};

0 commit comments

Comments
 (0)