You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PythonCodeSplitter: secondary-split pieces all report the whole function's start_line/end_line #13436
Describe the bug
When PythonCodeSplitter falls back to the line-based secondary split for an oversized function or method, every piece gets the start_line / end_line of the whole function. A function on lines 7-47 split into 9 pieces gives 9 documents that all say start_line=7, end_line=47, so a retrieved piece can't be mapped back to the code it contains (e.g. for "see lines X-Y" citations or editor links).
Expected behavior
Each piece reports the lines it covers (5-9, 8-15, 14-21, ... with the 2-line overlap), still clamped to the function's range. The primary split already does this for the chunks it builds.
Additional context _secondary_split deep-copies _build_chunk_meta([unit], ...) into every piece and doesn't use the split_idx_start offset that DocumentSplitter already gives each piece. I have a small fix with a regression test and can open a PR.
Activity