Files
codegraph/__tests__
DshuishuiandClaude Opus 5.5 44adef821b fix(erlang): a comment in an argument list no longer counts as an argument
Since PR #1615 made arity part of an Erlang function's identity, arity
is counted from the argument list's named children. tree-sitter reports
a comment as a named child, so a comment at the top level of a
parameter or argument list raised the count by one. A call written
plain( % note followed by two arguments was looked up as plain/3 and
linked to nothing, a definition with a comment between its parameters
was indexed one arity too high, and the MFA list of spawn(M, f, [A, B])
with a comment between A and B gave f/3. A comment nested deeper,
inside a tuple, a record or a list argument, was never affected.

The three counts now go through one namedArgCount helper that leaves
comments out: a clause's and a spec's arity, a call site's arity, and
the MFA list's.

Conflict resolution: the import block of tree-sitter.ts moved on main
since the PR; main's imports are kept, with namedArgCount added.

Validation: the new test fails on main (its fixture gets no call edge
at all) and passes here. A/B against main: rebar3 97e9367 gains 2 edges
(rebar_compiler.erl:403 and rebar_release_SUITE.erl:247, both calls
whose argument lists hold a comment, both checked against the source),
0 removed, nodes unchanged; cowboy 6475600 and ranch 7ec436d are
byte-identical, as are the controls express and flask. Erlang has no
kernel extractor, so there is no parity to run. Index CPU on rebar3,
median of 3 interleaved: 9.9 s on main, 9.3 s here.

Original PR #1619 by @Dshuishui.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 19:53:00 +00:00
..