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
dart: try/finally keywords misdetected as zero-arg function declarations #1622
Dart's try and finally keywords at line start are misdetected as phantom zero-arg function declarations because the func_start regex's negative-lookahead exclusions (at alternatives A/B/C boundaries) exclude class|mixin|enum|extension|typedef|if|for|while|switch|catch|case|when|assert|return|throw|new|var|final|const — but never try or finally. So try { / finally { matches as a function literally named "try"/"finally".
Confirmed repro
Direct regex test (from activated venv with gitgalaxy installed):
Corpus impact (confirmed via tests/tools/tree_sitter_accuracy_audit.py --lang dart):
language-crucible/data/dart/flutter/*.dart corpus: 38 rows in function_data literally named "try"
These account for ~9% of dart's remaining func_start false-positive rate
The same gap applies to finally (though this corpus has zero finally-named false positives)
Fix direction
Add try and finally to the negative-lookahead exclusion lists in dart's func_start regex (all 3 occurrences at alternatives A/B/C boundaries), matching the existing catch handling immediately adjacent to them in the pattern.
Labels
bug, core-engine
File location
gitgalaxy/standards/language_standards.py line ~9322-9345 (dart func_start regex)
Activity
fix(dart): teach tree-sitter ground truth to see getters/setters/oper…
fix(dart): stop treating try/finally blocks as function declarations (s…