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
bug(indexer): Python annotated parameters without a default (x: str) are silently dropped — 41.8% of parameters lost #1520
Parameter extraction looks up a name field on every parameter node:
child.child_by_field_name('name')
In tree-sitter-python, typed_default_parameter (x: int = 5) has a name field, but typed_parameter (x: int) does not — it exposes only type. So the lookup returns None and the parameter is silently discarded.
x: str is gone. z: int = 5 survives only because it is a different node type.
Blast radius
Measured against the stdlib ast module over CGC's own src/:
real parameters (ast): 3154
extracted by the parser: 1835
lost: 1319 (41.8%)
Every annotated-but-undefaulted parameter — the dominant style in any typed Python codebase, and in this repo — never becomes a Parameter node and never gets a HAS_PARAMETER edge. Since CGC's own source is heavily annotated, self-indexing loses over 40% of parameters.
Suggested fix
Handle typed_parameter explicitly: its identifier is the first identifier child rather than a name field.
Environment
Commit
c0e0bed (main)
Python
3.12.3, Linux
Reproduced with the snippet above; the 41.8% figure measured by diffing parser output against ast over src/.
Activity
github-actions commentedon Aug 1, 2026
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ
fix(parsers): recover Python annotated parameters and Go grouped impo…
chore(release): bump version to 0.5.5 (#1569)