GitNexus/gitnexus/test/unit/scope-resolution/csharp
Gergo Magyar 908798af0b feat(csharp-scope): parity Unit 1 — this/base receiver-binding synthesis
Closes 3 parity failures (51 → 48). Target bucket: Category C from the
parity plan.

Changes:
- `languages/csharp/receiver-binding.ts` (new): walks up from a
  function node to the enclosing class/struct/record/interface,
  synthesizes `@type-binding.self` captures with boundName `'this'`
  (and `'base'` when the enclosing type is a class/record with an
  explicit base_list entry). Skips static methods and interface /
  struct `base` cases. Anchors to the method's `body` block so the
  scope-extractor's positionIndex places the binding inside the
  function scope (not the enclosing class scope).
- `languages/csharp/captures.ts`: route `@scope.function` matches
  through the synth, emitting the receiver captures as separate
  matches.
- `languages/csharp/interpret.ts`: map `@type-binding.self` to
  `source: 'self'` (parity with Python).
- `languages/csharp/query.ts`: explicit patterns for `this.X()`,
  `base.X()`, and `this.X = ...` / `base.X = ...` assignment writes.
  `this` and `base` are anonymous tokens in tree-sitter-c-sharp so
  the existing `expression: (_)` pattern (named-only) didn't match.

Tests:
- 8 new unit tests for receiver-binding synthesis edge cases
  (class/struct/record/interface, static, nested, constructor,
  local function inside method).
- Parity: 48 failed | 127 passed (175) under REGISTRY_PRIMARY_CSHARP=1;
  legacy path 175/175 green.
2026-04-21 18:26:00 +01:00
..
csharp-captures.test.ts feat(csharp-scope): parity Unit 1 — this/base receiver-binding synthesis 2026-04-21 18:26:00 +01:00
csharp-hooks.test.ts feat(csharp-scope): Unit 5 — arity metadata synthesis + compatibility 2026-04-21 17:27:36 +01:00
csharp-imports.test.ts feat(csharp-scope): Unit 2 — import interpret + target resolver 2026-04-21 17:04:24 +01:00