Lua: allow declaring custom module-loader functions so Require("path.lua") maps to import edges
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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_refscontains exactly 691 entries namedRequire, matching the number ofRequire(...)call sites in the source.- The whole index has 2
importsedges, both from a standardrequire("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.
- Lenguaje dominante
- C
- Estrellas
- 73.2k
- Forks
- 4.7k
- Merge medio
- 2 h 13 min
- PR fusionados (30 d)
- 418
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de colbymchenry/codegraph
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
colbymchenry/codegraph#2634 ·
Los mantenedores suelen responder en 1 día
-
Windows: bundled Node v24.16.0 can abort at exit (nodejs/node#56645); please bundle Node >= 24.20.0Posiblemente ocupada @Ancienttwo la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
colbymchenry/codegraph#2617 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Invalid regular expression: /\boperator++\s*(?:<[^<>()]*>)?\s*\(/: Nothing to repeat (v1.6.2)Abierto
Dificultad 2/5 Menos de una hora Aptitud para principiantes 72/100
colbymchenry/codegraph#2482 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
codegraph ui - does not workAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
colbymchenry/codegraph#1900 · 2 comentarios · 5 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
colbymchenry/codegraph#1700 ·
Los mantenedores suelen responder en 1 día
Todos los issues de colbymchenry/codegraph
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
FujiNetWIFI/fujinet-firmware#2045 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
OpenPrinting/cups#1772 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
snowballstem/snowball#311 ·
-
tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día