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
Call nodes under //line directives get empty byte spans #21
Describe the bug
Call nodes in a file with a //line directive get an empty byte span. Their positions come from the directive-adjusted line:col, while byte offsets index the real file, so slicing module.source returns an empty string.
To Reproduce
A Go file containing //line virtual.y:900:1 followed by a function that makes calls.
cango -i <dir> -a 1 -o /tmp/out
Inspect those call nodes' span.bytes: start equals end (e.g. [433,433]).
Expected behavior span.bytes covers the call's real text in the file, so source slicing recovers it. The line:col can stay directive-adjusted or be real, as long as the doc says which.
Logs
Observed in the testdata/dataflow/linedir fixture added by PR #16.
Additional context
Affects generated code: goyacc, ragel, templ, cgo output. Predates PR #16. The call callee resolution under //line is fixed in that PR; only the span is still wrong.
Activity
sinha108 commentedon Oct 25, 2026
Consolidated into #26, which carries this issue's full detail.