LuaLS / LuaLS/lua-language-server
Treat class field as special function (such as `type`)
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Lua
- Estrellas
- 4.4k
- Forks
- 442
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
In Factorio, all the API classes have a `object_name` field (not function!), which identifies their class name, much like `type()` does for base types. We're currently handling this with a plugin that rewrites this from `obj.object_name` to look like `__object_name(obj)` which is then tagged as ```
"Lua.runtime.special": {
"__object_name": "type"
},
```, to get it to work properly in type-tests, but it would be nice to be able to indicate that a class field "acts like `type`" in this way directly.
Guía de contribución
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.
Línea de trabajo
Start by reviewing the existing plugin rewrite from obj.object_name to __object_name(obj) and the Lua.runtime.special mapping to type. Trace how type-tests consume that mapping, then verify that a direct class-field declaration preserves the same behavior without the rewrite.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- lua
- Área
- tooling
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100