Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Lua: allow declaring custom module-loader functions so Require("path.lua") maps to import edges

オープン
#1,617 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
lua
領域
devtools

調査の方向性

No implementation files or tests are named. Start by tracing how standard Lua require calls become import edges and how per-project language configuration is handled, using the cited #906 configuration pattern and #660 dependency-edge fix as context. Add coverage for configured loader functions with string-literal and non-literal arguments; done means literal paths resolve to import edges and non-literals retain the current unresolved-call behavior.

索引モデルが issue の本文から書いたものです。

説明

Summary

Feature request: let a project declare which functions act as module loaders, so calls like Require("Script/Foo.lua") become imports edges instead of unresolved calls.

Standard require("mod.name") already works — that is not the issue. The gap is codebases that ship their own loader, which is common in embedded Lua (games, plugin hosts) where the host defines a path-based loader rather than using package.path.

Current behaviour

On an indexed 2,107-file Lua game client:

  • unresolved_refs contains exactly 691 entries named Require, matching the number of Require(...) call sites in the source.
  • The whole index has 2 imports edges, both from a standard require("perf.profiler") in one file.
  • So the file→file dependency layer is empty, even though every path is a plain string literal: Require("Script/Activity/ActivityMgrC.lua").

callers on a module file returns 0, and impact on it cannot see the files that load it.

Proposed

Config key listing loader function names, e.g.

{ "lua": { "loaderFunctions": ["Require", "Include"] } }

When a listed function is called with a string literal, resolve it against the project root (and any configured roots) and emit an imports edge to the target file node; fall back to the current unresolved-call behaviour when the argument is not a literal.

Precedent

  • #660 — PHP include/require(_once) were not mapped to dependency edges; fixed. Same shape of problem, except there the construct is language syntax, so no configuration was needed. For Lua the loader is user-defined, hence the config key.
  • #906 — custom extension → language mapping was accepted as opt-in config, so per-project language config already exists as a pattern.

Notes

Low priority relative to #1616: this one only degrades the dependency layer, and only for projects with a custom loader. Standard require users are unaffected.

主要言語
C
スター
73.2k
フォーク
4.7k
平均マージ
2時間 13分
マージ済み PR(30日)
418

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

colbymchenry/codegraph のほかの issue

colbymchenry/codegraph の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。