You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lua extractor misses bare require() statements (no assignment) #3320
graphify.extract._import_lua only extracts an imports edge from Lua require(...) calls when they appear inside a variable_declaration node (i.e. local x = require("mod")). The far more common Neovim-config idiom — a bare require("mod") statement with no assignment — produces no edge at all.
This makes graphify's dependency graph badly undercount structure for any Lua/Neovim config, since files like init.lua typically do:
frompathlibimportPathfromgraphify.extractimportextract# bare require() - no edgePath("a").mkdir(exist_ok=True)
Path("a/init.lua").write_text('require("config.lazy")\n')
Path("a/config.lazy.lua").write_text('-- lazy config\n') # or lua/config/lazy.lua per module pathr1=extract([Path("a/init.lua"), Path("a/config.lazy.lua")], cache_root=Path("a"))
print(r1["edges"]) # []# assigned require() - edge produced correctlyPath("b").mkdir(exist_ok=True)
Path("b/init.lua").write_text('local ok = require("config.lazy")\n')
Path("b/config.lazy.lua").write_text('-- lazy config\n')
r2=extract([Path("b/init.lua"), Path("b/config.lazy.lua")], cache_root=Path("b"))
print(r2["edges"]) # [{'source': 'init', 'target': 'config_lazy', 'relation': 'imports', ...}]
Confirmed against a real 14-file LazyVim/Neovim config where init.lua calls require("config.lazy") (bare) and every lua/config/*.lua / lua/plugins/*.lua file loaded this way ended up with zero import edges — resulting in a graph with 13 nodes but only 2 edges, all "contains" (function-in-file) relationships.
Expected
_import_lua should also fire on bare call-expression statements (a require(...) call used as a standalone statement, not just when assigned to a variable), so the common require("module")-with-no-assignment idiom resolves to an imports edge like the assigned form does.
Environment
graphifyy installed via uv tool install graphifyy
Reproduced via graphify.extract.extract() directly
Activity
fix(lua): emit an imports edge for bare require() statements (Graphif…
docs(changelog): note the Lua bare-require fix (Graphify-Labs#3320)
test: cover bare require() imports edges for Lua (#3320)
fix(lua): emit imports edge for bare require() statements (#3320)
docs(changelog): note the Lua bare-require fix (#3320)
safishamsi commentedon Sep 15, 2026
Fixed in v0.9.62 (on PyPI) via #3519, thanks @A-Levin. Thanks for the report!
fix(extract): treat Luau as Lua family in the engine's Lua-only paths (…