MCPcopy Index your code
hub / github.com/idank/explainshell / _number_block

Function _number_block

explainshell/extraction/llm/text.py:225–231  ·  view source on GitHub ↗
(start_line: int, block_text: str)

Source from the content-addressed store, hash-verified

223 width = len(str(total_lines))
224
225 def _number_block(start_line: int, block_text: str) -> str:
226 lines = block_text.split("\n")
227 numbered = []
228 for j, line in enumerate(lines):
229 lineno = start_line + j
230 numbered.append(f"{lineno:>{width}}| {line}")
231 return "\n".join(numbered)
232
233 def _split_by_lines(start_line: int, block_text: str) -> list[tuple[int, str]]:
234 """Last-resort split: cut at line boundaries to fit budget."""

Callers 2

_split_by_linesFunction · 0.85
chunk_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected