usages: whole types silently dropped from userDefinedTypes when several files are scanned together (c)
- Dominant language
- Rust
- Stars
- 98
- Forks
- 10
- Avg merge
- 6h 19m
- Merged PRs (30d)
- 1
Description
## Summary
`atom usages -l c` silently drops whole entries from `userDefinedTypes` in the emitted
`usages.json`. atom exits `0`, prints no warning, writes well-formed JSON, and lists every scanned
file in `objectSlices` — the types are simply not there.
**Which types go missing changes from run to run over a byte-identical tree.**
Reproduced on **v3.1.1** (current release) and **v3.0.3**, Linux 5.15 (WSL2), x86-64, 8 cores, with
the bundled JDK 23.
## Reproduction
Two files per module: a uniquely-named header with one named struct typedef, and a `.c` that includes
it and uses the type. No build system, no external headers.
```bash
#!/bin/bash
# make-tree.sh [n]
set -eu
root="$1"; n="${2:-10}"; rm -rf "$root"
for i in $(seq 1 "$n"); do
d="$root/mod$i"; mkdir -p "$d"
cat > "$d/Cfg$i.h" < "$d/usa$i.c" <
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the `atom usages -l c` entry point and the generated `usages.json`. Rebuild the tree for each run with the supplied `make-tree.sh` reproduction, then compare `userDefinedTypes` with the ten structs expected from the scanned C files. Done means every type is present reliably, with no silent loss when several files are scanned together.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, rust
- Domain
- cli, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100