fix: merge stub nodes with real cross-language definitions#442
Open
V0v1kkk wants to merge 1 commit intosafishamsi:v4from
Open
fix: merge stub nodes with real cross-language definitions#442V0v1kkk wants to merge 1 commit intosafishamsi:v4from
V0v1kkk wants to merge 1 commit intosafishamsi:v4from
Conversation
When C# code inherits from a type defined in F# (e.g. SqliteBookStore extends BookStore from Interfaces.fs), the C# extractor creates a stub node with an empty source_file. This stub disconnects the inheritance edge from the real F# definition. Add a post-extraction pass that merges stub nodes into real definitions by matching labels. Prioritize definition files (Interfaces.fs, Domain.fs, Types.fs) so inherits edges point to abstract types rather than implementation classes. Made-with: Cursor
V0v1kkk
added a commit
to V0v1kkk/graphify
that referenced
this pull request
Apr 18, 2026
Add upstream contribution status: 3 graphify PRs (safishamsi#440-safishamsi#442), 1 tree-sitter-razor PR (safishamsi#19), 1 tree-sitter-fsharp issue (safishamsi#176). Document fork locations, blocked PRs, and final test metrics. Fix document structure (reorder commit 7, remove duplicated sections). Made-with: Cursor
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.
Fixes #439
Summary
Adds a post-extraction pass that merges stub nodes (nodes with no
source_file, created by the generic extractor for unresolved type references) with their actual definitions from other files.When C# code inherits from a type defined in F# (e.g.
class SqliteBookStore : BookStore), the C# extractor creates a stub nodebookstorebecause it can't resolve the base type. Meanwhile, the F# extractor creates the real nodeinterfaces_bookstorefromInterfaces.fs. Theinheritsedge incorrectly points to the stub instead of the real definition.The fix:
source_file) that have a matching real definition (by label match)Interfaces.fs,Domain.fs,Types.fs,Contracts.fs,Abstractions.fs)Impact
Tested on a mixed F#/C# project — all cross-language
inheritsedges now point to real definitions. This is particularly important for mixed-language codebases where interfaces/abstract types are defined in one language and implemented in another.Test Plan
inheritsedges now correctly point to real definitions