Summary
The Lua reference extractor is a thin pass-through with minimal language-specific logic. Idiomatic Lua patterns produce no symbols or references:
- Method calls via
: colon syntax: obj:method()
local function foo() end declarations
function tbl.k.l(arg) table-key function definitions
- Varargs
function f(...) and function f(a, ...)
- Table indexing as a reference site:
local x = t.field
Evidence
-
src/CodeIndex/Indexer/References/Languages/LuaReferenceExtractor.cs:1-50 — EmitAdditionalCallReferences matches only the regex ^\s*(?<name>[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)?)\s+(?=[\"'\{A-Za-z_]) (command-style calls with space-separated args).
-
Reproducer:
local M = {}
local function helper() return 1 end
function M.work(x, ...)
return self:run(x)
end
return M
Indexing this file produces effectively no symbol or reference data beyond what the generic scanner extracts.
Impact
- Lua codebases (game scripting, OpenResty, Neovim plugins) get a degraded indexing experience compared to other supported languages.
references and callers against Lua targets return little useful data.
Proposed direction
- Add explicit handlers for the four idioms above (method-colon,
local function, table-key def, varargs).
- Add a unit test for each idiom.
- Reuse the container-stack pattern used by other extractors for nested function definitions.
Repro env
- Branch:
main @ 2ee912d (release v1.21.0)
Summary
The Lua reference extractor is a thin pass-through with minimal language-specific logic. Idiomatic Lua patterns produce no symbols or references:
:colon syntax:obj:method()local function foo() enddeclarationsfunction tbl.k.l(arg)table-key function definitionsfunction f(...)andfunction f(a, ...)local x = t.fieldEvidence
src/CodeIndex/Indexer/References/Languages/LuaReferenceExtractor.cs:1-50—EmitAdditionalCallReferencesmatches only the regex^\s*(?<name>[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)?)\s+(?=[\"'\{A-Za-z_])(command-style calls with space-separated args).Reproducer:
Indexing this file produces effectively no symbol or reference data beyond what the generic scanner extracts.
Impact
referencesandcallersagainst Lua targets return little useful data.Proposed direction
local function, table-key def, varargs).Repro env
main@ 2ee912d (release v1.21.0)