Skip to content

fix(lua): index assignment-style function definitions (#1650) - #1778

Merged
colbymchenry merged 1 commit into
mainfrom
forge/fix-1650-lua-assigned-functions
Sep 8, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
forge/fix-1650-lua-assigned-functions

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

Summary

Fixes #1650 (also #1616).

Lands upstream #1623 by @danusha2345 onto current main: Lua/Luau X.Y = function() … end, local f = function() … end, and function-valued keyed table fields are indexed as callable symbols so cross-file callers stop looking complete when they are not.

Linux verify (fail → pass)

Issue repro power.lua + client.lua on Linux x64 / Node 22.19.0 with native kernel:

Check Before After
Nodes / edges 3 / 2 4 / 4
EPR.PowerController::SyncHydroPower absent method at power.lua:5
callers syncHydroPower power.lua (file only) SyncHydroPower
callers SyncHydroPower n/a client.lua
Impact depth-2 of syncHydroPower same-file only includes client.lua

Chain: client.lua → SyncHydroPower → syncHydroPower

Tests

  • CODEGRAPH_KERNEL_EXPECT=1 extraction + resolution + kernel-lua-parity: 844 passed
  • Forced-WASM Lua/Luau filter: 20 passed
  • Kernel rebuilt via scripts/build-kernel.sh (linux-x64)

Credits

Upstream implementation and regressions from #1623 (@danusha2345). This PR rebases that work onto current main and adds the #1650 citation + Linux repro verification.

Apply upstream PR #1623 by danusha2345 (fix commit aa77706),
which also addresses #1616, to the current main base. Preserve the
upstream WASM and Rust implementations and regression coverage.

Index assigned locals, table members, static string keys and nested
callback tables as callable symbols, with calls owned by those symbols.
Keep dynamic keys unguessed. Add #1650 to the Unreleased changelog and
retain the existing re-index guidance without an extraction-version bump.

Verified on Linux x64 with Node 22.19.0:
- native kernel build, tsc, asset copy, executable CLI
- issue repro: 3 nodes / 2 edges -> 4 nodes / 4 edges
- EPR.PowerController::SyncHydroPower is indexed; its caller is client.lua
- syncHydroPower depth-2 impact reaches client.lua
- extraction/resolution/Lua parity: 844 tests passed (kernel expected)
- forced-WASM Lua/Luau extraction/resolution: 20 tests passed
@colbymchenry
colbymchenry merged commit 8c04734 into main Sep 8, 2026
@colbymchenry
colbymchenry deleted the forge/fix-1650-lua-assigned-functions branch September 8, 2026 15:50
bompus added a commit to bompus/codegraph that referenced this pull request Sep 8, 2026
Second reconcile of the day. Upstream landed colbymchenry#1776 and colbymchenry#1778 after this
morning's merge (82cf9f0), and colbymchenry#1778 rewrote the lua variable-pairing code
in both arms, where the fork hangs markdown references off the node it
creates. Three conflicts, two of them the same collision twice.

true merge, both sides needed:
  codegraph-kernel/src/lua.rs     upstream's `value.map(...)` replaces the
                              fork's `values.get(i).map(...)`; the fork's
                              `let row = self.create_node(` is kept because
                              the markdown-refs block below the conflict
                              binds `row` and merged cleanly, so upstream's
                              side alone does not compile.
  src/extraction/tree-sitter.ts   the same shape in the WASM arm: upstream's
                              `target.name` with the fork's `const varNode`
                              capture and extractMarkdownPathReferences call.

union, upstream only:
  CHANGELOG.md                the fork side is empty, so this is upstream's
                              colbymchenry#1652 and colbymchenry#1730/colbymchenry#1731 entries verbatim.
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.

Lua: assignment-style function definitions (X.Y = function()) are not indexed — and the resulting caller list looks complete

1 participant