lukehutch · GitHub

Describe the bug

"Find all references" seems to discriminate between this. parameters and the fields they map to. I don't think there should be a distinction.

To Reproduce

Create these two classes:

class X {
  int x;  // (1)
  X({required this.x});  // (2)
}
class Y {
  void foo() {
    X(x: 1);  // (3)
  }
}

Actual behavior

The numbers (1), (2), and (3) infer positioning the cursor at x on the correspondingly numbered line, and then right-clicking and selecting "Find all references":

  • "Find all references" at (1) finds only (1) and (2).
  • "Find all references" at (2) finds only (1) and (3).
  • "Find all references" at (3) finds only (2) and (3).

Expected behavior

"Find all references" at any of (1), (2), or (3) should find all three.

(Dart 3.3.0 on Linux)

Read the original on github.com ↗