feat(code-graph): add Lua language support with require import extraction
[skip query-dsl-version-check]
Closes #764 (closed)
What does this MR do and why?
Adds Lua as a fully indexed language in the knowledge-graph pipeline.
Definitions — both global and local function forms are extracted:
function foo() end→function_declarationlocal function foo() end→local_function
Imports — require("module.path") calls are extracted as Require
ImportedSymbol nodes. Handles double-quotes, single-quotes, and the
bare require "mod" form (no parentheses).
Wiring — all layers updated in one commit:
tree-sitter-lua 0.5.0added totreesitter-visit/Cargo.tomlSupportLang::Luaregistered inlanguages.rsLanguage::Luadeclared indefine_languages!(ext:.lua, sep:.)LuaDsl/LuaRulesinlangs/generic/lua.rs(10 unit tests)GenericPipeline<LuaDsl, LuaRules>registered inregistry.rs- 2 YAML fixture suites +
suites.rsentries
Related issues
Closes #764 (closed)
Testing
- 10 unit tests in
lua.rscover both definition forms and all require variants - 2 YAML integration fixtures:
lua/function_definitions.yaml,lua/require_imports.yaml
Label: Hackathon
What does this MR do and why?
Related Issues
Testing
Performance Analysis
- This merge request does not introduce any performance regression. If a performance regression is expected, explain why.
Agent context — long-form analysis, file-by-file walkthroughs, profiler output, alternatives considered
- feat(code-graph): add Lua language support with require import extraction
Implements Lua as a first-class indexed language (closes #764 (closed)):
- Register tree-sitter-lua 0.5.0 as an optional dependency in the treesitter-visit crate and add it to the builtin-parser feature set
- Add SupportLang::Lua variant wired to tree_sitter_lua::LANGUAGE
- Declare Language::Lua in define_languages! with .lua extension and dot-separated FQN separator (matching Lua module conventions)
- Implement LuaDsl / LuaRules in langs/generic/lua.rs:
- function_declaration scope for global
function foo() end - local_function scope for
local function foo() end - on_import hook: extracts require("module.path") calls as
Require ImportedSymbols; handles both quote styles and the
require "bare"(no-parens) form via strip_lua_string - 10 unit tests covering all definition and import variants
- function_declaration scope for global
- Register GenericPipeline<LuaDsl, LuaRules> in registry.rs
- Add two YAML fixture suites (function_definitions, require_imports) and register them in integration-tests-codegraph/tests/suites.rs
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com