Skip to content

Add a tree-less Lua lane: the code index reads .lua files as text only #625

Closed

Description

@zlareb1

Component

Code index

Use case

The code index reads .lua files as plain text today: they are chunked and searchable, but code.symbol, code.callers and code.outline know nothing in them (.lua is in _CODE_TEXT_EXTENSIONS in server/code/domain/extract/lang_text.py). A repository whose API or scripts live in Lua files gets no structure from them.

Describe the solution you'd like

Goal. A tree-less Lua lane (no new tree-sitter dependency) that gives those files symbols and edges, following docs/development/adding-language-support.md.

Files to start from

  • docs/development/adding-language-support.md: the whole procedure, including the extractor-stamp rule. A lane outside the stamp re-chunks nothing on existing deployments.
  • lang_proto.py for the scanner shape and lane_units.py for chunks and call binding.
  • server/code/domain/extract/lang_detect.py (LANG_BY_EXTENSION), server/code/app/index/ingest_parse.py (_PARSERS) and server/code/domain/extract/lang_text.py (remove the extension from the text list).

Acceptance criteria

  • server/code/domain/extract/lang_lua.py with parse_lua(path, source) -> ParsedFile: function a.b(), function a:b(), local function f() and M.f = function() as function symbols, qualified by the module path.
  • Reference sites for calls f(...) and a.b(...) bound by lane_units.bind_sites, and require("a.b") as an include, bound with lane_units.bind_sites; built-in and unknown names bind to nothing.
  • The module is listed in NON_EXTRACTOR_MODULES in tests/unit/test_code_extractor_stamp.py, and no stamped module changes.
  • Fixtures under tests/fixtures/code_lanes/lua/ (synthetic, or an excerpt under its own licence listed in tests/fixtures/code_lanes/NOTICE.md), with expected.json regenerated and its diff reviewed.

How to test

.venv/bin/python -m pytest tests/unit/test_code_lang_lua.py tests/unit/test_code_extractor_stamp.py tests/unit/test_code_lanes_corpus.py tests/unit/test_code_regex_cost.py
.venv/bin/python -m tests.code_lanes.corpus --write && git diff tests/fixtures/code_lanes/expected.json

The cost test needs a SAMPLES entry in tests/unit/lane_walks.py for the new parser, so a pathological file cannot make the lane slower than linear.

Size: M (a day or two).

Describe alternatives you've considered

A tree-sitter grammar lane gives more, but adds a dependency (a material change discussed in an issue first). The tree-less shape is what the proto, HCL and Jsonnet lanes use.

Where the need comes from

The need is mine, an AI tool helped shape the proposal

Additional context

A good first issue: one new module, its tests and fixtures, no stamped code. Read CONTRIBUTING.md first (signed-off commits), and comment here to say you are working on it.

Activity

  1. added
    enhancement
    good first issue
    help wanted
    on Nov 13, 2026
  2. rahulsjha commented on Nov 15, 2026

    @rahulsjha
    Contributor

    Hi @zlareb1, I'd like to take this one too. Plan: lang_lua.py as a tree-less scanner in the shape of lang_proto.py, covering function a.b(), function a:b(), local function f() and M.f = function(); calls and require(...) bound with lane_units.bind_sites; listed in NON_EXTRACTOR_MODULES; synthetic fixtures, regenerated expected.json, and a SAMPLES entry for the cost test. Could you assign it to me?

  3. added
    up-for-grabs
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issuehelp wantedup-for-grabs

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions