Hi, and thanks for CodeGraph. It's been the most accurate code graph I've tried on a mixed Dart/TypeScript codebase.
While working on a project of mine I asked for the callers of a small getter I'd added on an enum, and CodeGraph said nothing calls it. In fact it's used in several places. I cut it down to a minimal example and found two separate gaps.
Version: CodeGraph 1.6.2 (standalone install, linux-x64), fresh codegraph index .
lib/shape.dart
enum Shape { circle, square }
extension ShapeInfo on Shape {
String get label => name.toUpperCase();
String shout() => name.toUpperCase();
}
class Box {
const Box(this.size);
final int size;
int get area => size * size;
int grow() => size + 1;
}
extension BoxActions on Box {
int twice() => size * 2;
}
lib/use.dart
import 'shape.dart';
String a(Shape s) => s.label; // getter, extension on enum
String b(Shape s) => s.shout(); // method, extension on enum
int c(Box x) => x.area; // getter, plain class
int d(Box x) => x.grow(); // method, plain class
int e(Box x) => x.twice(); // method, extension on class
codegraph callers … |
expected |
got |
grow |
d |
✅ d |
twice |
e |
✅ e |
area |
c |
❌ 0 callers |
label |
a |
❌ 0 callers |
shout |
b |
❌ 0 callers |
1. Getter reads are never recorded as calls, even on a plain class (x.area). The getter itself is indexed (Box::area), but nothing links to it, so callers and impact miss every place that reads it.
2. Extension members on an enum aren't resolved, while the same thing on a class works (twice).
It's the same inside block-bodied functions and inside class methods, not only => functions.
Happy to test a fix if that helps.
Hi, and thanks for CodeGraph. It's been the most accurate code graph I've tried on a mixed Dart/TypeScript codebase.
While working on a project of mine I asked for the callers of a small getter I'd added on an enum, and CodeGraph said nothing calls it. In fact it's used in several places. I cut it down to a minimal example and found two separate gaps.
Version: CodeGraph 1.6.2 (standalone install, linux-x64), fresh
codegraph index .lib/shape.dartlib/use.dartcodegraph callers …growddtwiceeeareaclabelashoutb1. Getter reads are never recorded as calls, even on a plain class (
x.area). The getter itself is indexed (Box::area), but nothing links to it, socallersandimpactmiss every place that reads it.2. Extension members on an enum aren't resolved, while the same thing on a class works (
twice).It's the same inside block-bodied functions and inside class methods, not only
=>functions.Happy to test a fix if that helps.