Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
line_chunks
codeintel.parsers.line_chunks
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| ParseResult | base.py | through an import |
| Symbol | base.py | through an import |
| add_identifier | base.py | unique name |
| Symbol | File | Resolved by |
|---|---|---|
| parse_file | __init__.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| parsers | __init__.py | same file |
codeintel.parsers.line_chunksbackend/app/codeintel/parsers/__init__.py, lines 32–62Open source
def line_chunks(path: str, source: str, language: str, reason: str) -> ParseResult: """Fixed-size overlapping line windows for files without AST support.""" lines = source.splitlines() total = max(1, len(lines)) symbols: list[Symbol] = [] step = FALLBACK_CHUNK_LINES - FALLBACK_OVERLAP_LINES start = 0 while True: end = min(start + FALLBACK_CHUNK_LINES, total) window = lines[start:end] first = next((ln.strip() for ln in window if ln.strip()), "") sym = Symbol( name=f"{path.rsplit('/', 1)[-1]}:{start + 1}-{end}", qualified_name=f"{path}:{start + 1}-{end}", kind="block", start_line=start + 1, end_line=end, signature=first[:200], ) for ident in _IDENT_RE.findall("\n".join(window)): sym.add_identifier(ident) symbols.append(sym) if end >= total: break start += step return ParseResult( language=language, parser="line-fallback", symbols=symbols, fallback_reason=reason, )What the index recorded
- Signature
def line_chunks(path: str, source: str, language: str, reason: str) -> ParseResult:- File
backend/app/codeintel/parsers/__init__.py- Lines
- 32–62
- Parser
- python-ast
- Git blob
02097151776f80e9d044e640b7d140f7f516c1d3- Call sites
- 13 named, 3 resolved, 10 left unlinked
