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
ruby: a method's span runs past its end after a regex literal containing a quote #3646
Part of #3641. Shape ruby/call/outside-ts-function, 73 occurrences, validated in docs/self_scan/graph_comparison_ledger.json.
In ruby/rails/generator.rb, extract_anchors (line 233) is followed by check_fragment_identifiers (line 250). The engine lists correct, unescape and first on extract_anchors, but they're called only in check_fragment_identifiers. So extract_anchors's span runs past its end.
Likely trigger: the regex literal /<h\d\s+id="([^"]+)/ on line 236. Its unbalanced " can open a string for the literal shield or the slicer, so the end keywords that follow are hidden until a later " closes it.
Fix direction:
Treat Ruby /…/ regex literals (after (, ,, =, .scan, =~, keyword position) as literals in the ruby shield, as JS does.
Add a regression test: two methods, the first containing /"/.
The same bug inflates the spans in any Ruby file with quotes inside regexes, which affects calls_out_to, complexity and LOC.
Activity
Graph comparison: reconcile calls like the tri-comparison -- ledger, …
Graph comparison: reconcile calls like the tri-comparison — ledger, v…
ruby: a method's span no longer runs to EOF past a keyword in a liter…