Add GDScript and Godot scene graph support#1098
Open
i-snyder wants to merge 26 commits into
Open
Conversation
# Conflicts: # .cursor/rules/codegraph.mdc # __tests__/extraction.test.ts # src/extraction/grammars.ts # src/extraction/tree-sitter.ts # src/index.ts # src/installer/instructions-template.ts # src/mcp/server-instructions.ts # src/mcp/tools.ts # src/resolution/name-matcher.ts # src/types.ts
colbymchenry#364) Rebasing colbymchenry#364 onto current main pulled in applyLanguageGate, a cross-language-family gate main added to `references` lookups after colbymchenry#364 branched. GDScript node-path refs (language: gdscript) and scene nodes (language: godot_resource) were both absent from LANGUAGE_FAMILY, so sameLanguageFamily() returned false and every cross-file `.gd` -> `.tscn` node-path reference was silently dropped by the merge, even though it built and ran without error. Register gdscript/godot_resource as a shared 'godot' family, the same pattern as the existing csharp/razor -> 'dotnet' entry.
Adding a new language/framework extractor is a documented bump trigger for EXTRACTION_VERSION (see this file's own doc comment), so existing indexes are prompted to re-index and pick up GDScript/Godot support instead of silently staying stale.
The CLI's isGodotSceneInstanceComponent (src/bin/codegraph.ts) omitted the node.language === 'godot_resource' check its MCP counterpart (src/mcp/tools.ts) has, so the CLI's callers/impact matching was slightly looser than the MCP tools' for this case. CliSearchNode already lacked a `language` field even though the underlying Node type (and cg.searchNodes() results) always carries one - added it and brought the check in line with the MCP copy.
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.
Hi! I wanted to help move #364 forward since the original Godot/GDScript branch had drifted pretty far from
main.This PR rebases @KirisamaMarisa’s original work onto current
main, resolves the conflicts, and keeps the original extractor design intact. I also fixed the small amount of rebase fallout needed for current CodeGraph behavior, especially the language-family gate that was otherwise dropping valid.gdto.tscnreferences.I tested this with
npm install && npm run build, the focused Godot/GDScript extraction and resolution tests, and built-CLI smoke tests on both a small multi-file Godot 4 fixture and a real Godot 4 production codebase. The testing verified that Godot files index successfully, GDScript symbols are searchable with signatures, cross-file GDScript callers resolve,res://references resolve, node paths resolve into.tscnscene nodes, and instanced scene callers show up correctly.This is genuinely useful for Godot projects, where CodeGraph currently has no
.gd/.tscn/.trescoverage. I’d love to see @KirisamaMarisa’s work land, and I’m happy to adjust anything that would make this easier to review.