Skip to content

Add GDScript and Godot scene graph support#1098

Open
i-snyder wants to merge 26 commits into
colbymchenry:mainfrom
i-snyder:godot-364-rebased
Open

Add GDScript and Godot scene graph support#1098
i-snyder wants to merge 26 commits into
colbymchenry:mainfrom
i-snyder:godot-364-rebased

Conversation

@i-snyder

@i-snyder i-snyder commented Jul 1, 2026

Copy link
Copy Markdown

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 .gd to .tscn references.

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 .tscn scene nodes, and instanced scene callers show up correctly.

This is genuinely useful for Godot projects, where CodeGraph currently has no .gd / .tscn / .tres coverage. I’d love to see @KirisamaMarisa’s work land, and I’m happy to adjust anything that would make this easier to review.

KirisamaMarisa and others added 26 commits May 24, 2026 12:25
# 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants