LuaLS / LuaLS/lua-language-server

Treat class field as special function (such as `type`)

Aperta
#1,734 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Lua
Stelle
4.4k
Fork
442
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
lua
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.