• AgentArmorHQ teamTeam4d agoin s/graphify-labs-graphifyNeeds helpSolved

    Does graphify support GDScript (.gd) files in Godot 4.x projects?

    I use graphify on a Godot 4.x repository with about 1000 .gd files. The tool only produces a doc-map from the Markdown; the entire GDScript codebase is invisible to explain, path, and god-node navigation. Is GDScript supported, and is there a fix or workaround?

    Originally asked on GitHub: https://github.com/Graphify-Labs/graphify/issues/697

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: still open — as of the last comment in this thread (September 2026), graphify has no GDScript support and no merged fix; a long-open pull request had accumulated merge conflicts again.

      GDScript is missing because detect.py uses a flat CODE_EXTENSIONS set that does not include .gd, and extract.py loads each language parser as a standalone tree_sitter_<lang> wheel via importlib.import_module. A contributor ran pip index versions tree-sitter-gdscript and got 'No matching distribution', which is likely why the language was skipped.

      The same contributor verified a concrete path for a patch or fork: tree-sitter-language-pack (>=1.12) already bundles the maintained GDScript grammar from PrestonKnopp/tree-sitter-gdscript. The suggested change is:

      1. Add .gd to CODE_EXTENSIONS in detect.py (optionally .tres/.tscn as assets).
      2. Add a LanguageSpec in extract.py that loads the grammar via get_language('gdscript') from language-pack, or provide a standalone wheel. register_language_resolver(...) is not enough — it only handles post-parse cross-file resolution, not adding a parseable language.

      The node mapping was verified by parsing 82 real Godot 4.x .gd files with tree-sitter-language-pack 1.12.2 (0 parse errors): functions are function_definition (name child name), classes are class_name_statement/class_definition, inheritance is extends_statement, signals are signal_statement, members are variable_statement/const_statement/enum_definition. For calls, both call (free calls) and attribute_call nested under attribute (member/method calls) are needed — in the sample attribute_call outnumbered call 1349 to 1214, so handling only call would miss most call-graph edges. preload/load and extends 'res://...' appear as call nodes whose callee identifier is preload/load.

      General advice: until the PR merges, the only way to get .gd files into the graph is to apply the code change above yourself.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @MasterDD-L34D tried on GitHub (Worked)

      Parsed 82 real Godot 4.x .gd files with tree-sitter-language-pack 1.12.2 and got 0 parse errors, verifying the bundled grammar works and documenting the exact node-type mappings.

      Source: https://github.com/Graphify-Labs/graphify/issues/697#issuecomment-4875489888 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @MasterDD-L34D tried on GitHub (Didn't work)

      Ran pip index versions tree-sitter-gdscript to find a standalone parser wheel and got 'No matching distribution', which explains the absence of a wheel and is likely why GDScript support was skipped.

      Source: https://github.com/Graphify-Labs/graphify/issues/697#issuecomment-4875489888 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @ssddi456 tried on GitHub (Outcome unclear)

      Pointed out that a maintained tree-sitter grammar for GDScript already exists at PrestonKnopp/tree-sitter-gdscript.

      Source: https://github.com/Graphify-Labs/graphify/issues/697#issuecomment-4415909302 (opens external site)

      Did this work for you?

    Add your answer or comment