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() endfunction_declaration
  • local function foo() endlocal_function

Importsrequire("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.0 added to treesitter-visit/Cargo.toml
  • SupportLang::Lua registered in languages.rs
  • Language::Lua declared in define_languages! (ext: .lua, sep: .)
  • LuaDsl / LuaRules in langs/generic/lua.rs (10 unit tests)
  • GenericPipeline<LuaDsl, LuaRules> registered in registry.rs
  • 2 YAML fixture suites + suites.rs entries

Closes #764 (closed)

Testing

  • 10 unit tests in lua.rs cover 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?

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
  • 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

Merge request reports

Loading