Skip to content

feat: add Luau language support (#153)#165

Merged
tirth8205 merged 1 commit intotirth8205:mainfrom
azizur100389:luau-support
Apr 11, 2026
Merged

feat: add Luau language support (#153)#165
tirth8205 merged 1 commit intotirth8205:mainfrom
azizur100389:luau-support

Conversation

@azizur100389
Copy link
Copy Markdown
Contributor

Summary

  • Adds Luau (Roblox Lua) as a supported language, closing Luau Support #153.
  • Luau shares most AST node types with Lua, so the existing Lua constructs handler is reused.
  • Luau-specific type_definition nodes are mapped as Class nodes to capture type aliases (type Vector3 = { ... }).

Changes

  • code_review_graph/parser.py:
    • Added .luau extension mapping in EXTENSION_TO_LANGUAGE
    • Added "luau" entries to _CLASS_TYPES (with type_definition), _FUNCTION_TYPES, _IMPORT_TYPES, _CALL_TYPES
    • Extended 3 language == "lua" checks to language in ("lua", "luau")
  • tests/fixtures/sample.luau: Comprehensive fixture exercising type aliases, typed functions, table-based OOP (dot + colon syntax), require imports, and test functions
  • tests/test_multilang.py: 14 new tests in TestLuauParsing

What Luau parsing supports

  • Type aliases as Class nodes
  • Functions with type annotations
  • Table-based OOP (dot + colon syntax)
  • require() import detection
  • Function call and test function detection

Test Plan

  • 14 new Luau tests pass
  • All 14 existing Lua tests pass (no regression)
  • Full multilang suite: 129/129 pass
  • ruff check clean on changed Python files

Add Luau (Roblox Lua) as a supported language. Luau shares most AST
node types with Lua (function_declaration, function_call, variable_declaration,
dot/method_index_expression) so the existing Lua constructs handler is
reused. Luau-specific additions include type_definition mapped as a Class
node for Luau's type aliases.

Changes:
- Add .luau extension mapping in EXTENSION_TO_LANGUAGE
- Add luau entries to _CLASS_TYPES, _FUNCTION_TYPES, _IMPORT_TYPES, _CALL_TYPES
- Extend all language == "lua" checks to include "luau"
- Add type_definition as a Luau-specific class type
- Add comprehensive Luau fixture file (sample.luau)
- Add 14 Luau parsing tests in test_multilang.py
@tirth8205 tirth8205 merged commit 42ced96 into tirth8205:main Apr 11, 2026
1 check passed
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tirth8205 tirth8205 mentioned this pull request Apr 11, 2026
5 tasks
tirth8205 added a commit that referenced this pull request Apr 11, 2026
Unreleased fixes since v2.2.2 that users are complaining about:
- #208 Claude Code hook schema (fixes #97, #138, #163, #168, #172, #182,
  #188, #191, #201) — v2.2.2 generates an invalid hooks schema and
  timeouts in ms instead of seconds; PreCommit is also not a real event.
- #205 SQLite transaction nesting (fixes #110, #135, #181) — implicit
  transactions from the legacy sqlite3 default caused "cannot start a
  transaction within a transaction" on update.
- #166 Go method receivers resolved from field_identifier.
- #170 UTF-8 decode errors in detect_changes (fixes #169).
- #142 --platform target filters (fixes #133).
- #213 / #183 large-repo community detection hangs.
- #220 CI lint + tomllib on Python 3.10.
- #159 missing pytest-cov dev dep.
- #154 JSX component CALLS edges.

Plus features: #177 Codex, #165 Luau (#153), #217 REFERENCES edge,
#215 recurse_submodules, #185 gitignore default (#175), #171 gitignore
docs (#157).

Verified locally on Python 3.11: ruff clean, mypy clean, bandit clean,
691 tests pass, coverage 73.72%.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants