csharp: extract this./base.-qualified member calls - #466
Merged
Conversation
zzet
approved these changes
Aug 5, 2026
zzet
left a comment
Owner
There was a problem hiding this comment.
Two adjacent gaps found (inspired by PR, not directly related to PR)
-
this?.Foo()/base?.Foo()emits nothing — the conditional-access pattern has the identical condition: (_) blindness. Rare in practice (this is never null), but it's the same bug left half-fixed. -
C# records emit no member nodes at all.
public record Tower(int N) { public int Chime() {...} }produces a type node and its extends edge, and nothing else — every method in every record is invisible to the graph, so no call edges leave them. Records are idiomatic C# 9+, so this is a substantially bigger gap than the one this PR closes.
This was referenced Aug 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this.Foo()andbase.Foo()currently emit no call edge at all — both member-call query patterns capture the receiver withexpression: (_), butthisandbaseare anonymous tokens in tree-sitter-c-sharp, and a named-node wildcard never matches them. Every qualified self/base call in a C# codebase silently vanishes from the graph (noticeable onbase.OnActionExecuting(...)-style overrides, which are everywhere in ASP.NET code).Fix (extraction only, resolver untouched):
(member_access_expression "this" name: (identifier))and thebasetwin).this→ the innermost type's name,base→ its declared base class (discrimination mirrorsemitCSharpBaseList: first base-list entry that is a ctor-base or not I-prefixed; structs and interface-only bases stamp nothing and the call still emits as a plainmember_call).receiver_typethen rides the existing receiver-typed member binding path, sothis.Foo()binds the hiding member andbase.Foo()the base member with no new resolver machinery.Tests: extractor spec (edges +
receiver_typestamps for both qualifiers,new-hiding case) and an end-to-end resolver spec (this.Foo()→ hiding member,base.Foo()→ base member). Both watched red before the fix.internal/parser/languagesfully green;internal/resolverandinternal/indexerat their pre-existing Windows baselines with zero new failures.The second commit bumps the
csharpextractor version 3→4 so existing stores restage.csfiles and grow the new edges. Validated live on a counted C# fixture repo via exactly that path — binary swap, no store wipe, salt-triggered restage — with both call shapes binding their compiler-correct targets (this.X()→ thenew-hiding member,base.X()→ the base member) at 0.95 withreceiver_typestamped.