Skip to content

chore: codebase cleanup — bugs, dead code, perf#20

Merged
jahala merged 1 commit into
mainfrom
chore/codebase-cleanup
Mar 6, 2026
Merged

chore: codebase cleanup — bugs, dead code, perf#20
jahala merged 1 commit into
mainfrom
chore/codebase-cleanup

Conversation

@jahala

@jahala jahala commented Mar 6, 2026

Copy link
Copy Markdown
Owner

Summary

Comprehensive codebase review and cleanup. No new features, no API changes, no version bump.

  • 4 bug fixes: JSON outline key paths, C# property outline kind, empty-file mmap guard, import line numbering
  • 4 perf improvements: single metadata call per file, Arc content sharing, tree-sitter query caching, SystemTime sort fix
  • 4 dead code removals: cache TTL, tool_map chain, truncate dead logic, unused type variants
  • 1 deduplication: shared is_test_file utility

Net -24 lines across 15 files. All 56 tests passing, clippy + fmt clean.

Test plan

  • cargo clippy -- -D warnings — clean
  • cargo test — 56 passed, 0 failed
  • cargo fmt --check — clean

🤖 Generated with Claude Code

Bug fixes:
- Fix JSON outline using bare key instead of full dotted path for nested values
- Fix C# property_declaration mapped to OutlineKind::Function (now Property)
- Fix empty-file guard bypassed when section param is set (0-byte mmap)
- Fix format_imports using wrong entry for import block start line

Performance:
- Collapse double fs::metadata calls per file in callers search
- Share file content via Arc<String> across call sites (was N clones per file)
- Cache compiled tree-sitter queries via LazyLock<Mutex<HashMap>>
- Capture SystemTime::now() once before sort (was O(n log n) syscalls)

Dead code removal:
- Remove unused prune() + TTL infrastructure from cache
- Remove dead tool_map, record_map, maps counter chain
- Remove dead is_plain_assignment + unreachable branch in truncate
- Remove unused OutlineKind::Method variant and Match::column field

Cleanup:
- Deduplicate is_test_file into shared types::is_test_file

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jahala jahala merged commit fe4ba49 into main Mar 6, 2026
1 check passed
@jahala jahala deleted the chore/codebase-cleanup branch March 6, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant