Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / module
parsers
codeintel.parsers
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 |
|---|---|---|
| _module_path | __init__.py | same file |
| line_chunks | __init__.py | same file |
| parse_file | __init__.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| languages | languages.py | through an import |
| base | base.py | through an import |
| python_parser | python_parser.py | through an import |
| treesitter_parser | treesitter_parser.py | through an import |
codeintel.parsersbackend/app/codeintel/parsers/__init__.py, lines 1–40Open source
"""Symbol extraction entry point.:func:`parse_file` always returns a :class:`ParseResult`. When ASTextraction is not possible the result has ``parser="line-fallback"`` and amachine-readable ``fallback_reason`` — fallbacks are visible in chunkmetadata, ingestion stats and the API, never reported as AST output."""from __future__ import annotationsimport refrom ..languages import detect_languagefrom .base import ParseResult, Symbolfrom .python_parser import module_path_for, parse_pythonfrom .treesitter_parser import grammar_status, parse_treesitter__all__ = ["ParseResult", "Symbol", "grammar_status", "parse_file", "line_chunks"]FALLBACK_CHUNK_LINES = 60FALLBACK_OVERLAP_LINES = 10_IDENT_RE = re.compile(r"[A-Za-z_][A-Za-z0-9_]{1,63}")def _module_path(path: str) -> str: if path.endswith((".py", ".pyi")): return module_path_for(path) stem = path.rsplit(".", 1)[0] if "." in path.rsplit("/", 1)[-1] else path return stem.replace("/", ".")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)Shows the first 40 of 89 lines. The rest is on GitHub at this commit.
What the index recorded
- Signature
module backend.app.codeintel.parsers- File
backend/app/codeintel/parsers/__init__.py- Lines
- 1–89
- Parser
- python-ast
- Git blob
02097151776f80e9d044e640b7d140f7f516c1d3- Call sites
- 1 named, 0 resolved, 1 left unlinked
- Outside this subset
- 5 more edges reach code outside the graph shown here
