fix(lua): index assignment-style function definitions (#1650) - #1778
Merged
Merged
Conversation
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
This was referenced Sep 8, 2026
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1650 (also #1616).
Lands upstream #1623 by @danusha2345 onto current
main: Lua/LuauX.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.tree-sitter.ts/lua.ts) and native kernel (lua.rs)X.Y = function()) are not indexed — and the resulting caller list looks complete #1650; re-index after upgradingLinux verify (fail → pass)
Issue repro
power.lua+client.luaon Linux x64 / Node 22.19.0 with native kernel:EPR.PowerController::SyncHydroPowerpower.lua:5callers syncHydroPowerpower.lua(file only)SyncHydroPowercallers SyncHydroPowerclient.luasyncHydroPowerclient.luaChain:
client.lua → SyncHydroPower → syncHydroPowerTests
CODEGRAPH_KERNEL_EXPECT=1extraction + resolution + kernel-lua-parity: 844 passedscripts/build-kernel.sh(linux-x64)Credits
Upstream implementation and regressions from #1623 (@danusha2345). This PR rebases that work onto current
mainand adds the #1650 citation + Linux repro verification.