@codegraphy-dev/plugin-godot
v2.2.5
Published
CodeGraphy Godot plugin
Downloads
1,007
Maintainers
Readme
CodeGraphy Godot
Adds Godot GDScript relationship analysis to CodeGraphy.
- Package:
@codegraphy-dev/plugin-godot - Plugin API:
@codegraphy-dev/plugin-api
Install
Install @codegraphy-dev/core first if the codegraphy CLI is not already available.
npm i -g @codegraphy-dev/plugin-godot
codegraphy plugins register @codegraphy-dev/plugin-godot
codegraphy plugins enable @codegraphy-dev/plugin-godot
codegraphy indexDetection coverage
.gdfiles:preload()load()extendsclass_namereferencesclass_namedeclarations as Symbol Nodes- function, constant, variable, and enum declarations as Symbol Nodes
- Structured parsing:
@gdquest/lezer-gdscriptparses GDScript beforepreload(),load(),ResourceLoader.load(), andclass_nameextraction, with text fallbacks for parser gaps.@fernforestgames/godot-resource-parserparses Godot 4.tscnand.tresfiles before external-resource dependency extraction, with text fallbacks for unsupported syntax.project.godotsections use the plugin's lightweight text parser for resource-bearing settings.
project.godot:application/run/main_scene[autoload]
.tscnand.trestext resources:[ext_resource ... path="res://..."]
Edge semantics
- Scene and resource text references are emitted as normal
loadedges withtype: static. project.godotresource-bearing settings are also emitted as normal staticloadedges.- The finer-grained plugin provenance is
sourceId: "ext-resource"for.tscn/.tresfiles andsourceId: "project-settings"forproject.godot. - The detector follows Godot's text-loader behavior more closely by accepting relative
path=values and preferring a matchinguid=target when one is known in the workspace. - This means they participate in the existing
loadEdge Type Graph Scope settings while still being attributable to Godot text-resource parsing. - GDScript
class_namedeclarations are emitted as class symbols withpluginKind: godot-class-name. When Symbol, Variable, andcontainsare enabled in Graph Scope, the Relationship Graph shows the declaration as a Symbol Node contained by its.gdfile. The Godotclass_nameGraph Scope row lives under Variable so the Variable parent toggle can hide these plugin-owned declaration symbols without erasing their own saved state. - GDScript function, constant, variable, and enum declarations are emitted as normal Symbol Nodes, so they use the shared Function, Constant, Variable, and Enum Graph Scope and Legend defaults.
- The Legend includes
Plugins/Godot/class_nameso these symbols can be styled separately from generic class symbols.
Example workspace
The repo fixture at examples/example-godot now includes:
project.godot→scenes/main.tscn,scripts/game_manager.gdscripts/player.gd→scenes/ui/loadout_preview.tscn,resources/player_loadout.tresresources/player_loadout.tres→scripts/data/player_loadout.gd,textures/player_card.pngscenes/ui/loadout_preview.tscn→resources/player_loadout.tres,scripts/ui/loadout_preview.gd,textures/player_card.png
That example also now looks like a small real Godot project: it has a valid project.godot, a main.tscn entry scene, an autoloaded GameManager, and concrete player/enemy/UI scenes around the .tscn/.tres fixtures.
Those .tscn/.tres fixtures intentionally use relative path= values, and the scene's resource reference also carries a uid= so the plugin exercises both Godot-style resolution paths.
