code-chunk 0.1.0

Split source code into RAG-friendly chunks that respect function and class boundaries. Brace and indent-aware, language-agnostic heuristics. Zero deps.
Documentation
  • Coverage
  • 100%
    2 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 19.37 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 244.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 14s Average build duration of successful builds.
  • all releases: 14s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • MukundaKatta/code-chunk
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • MukundaKatta

code-chunk

crates.io

Brace-aware code chunker for RAG. Splits source on function/class boundaries via brace-depth tracking — no language parser needed.

use code_chunk::chunk;
let src = "fn a() { 1 }\nfn b() { 2 }";
let chunks = chunk(src, 200);

Soft cap: oversize functions stay whole rather than splitting mid-body. Zero deps. MIT or Apache-2.0.