LuaLS / LuaLS/lua-language-server
Proper Parameter Support for Class Inheritance via "require" in "lua-language-server"
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 4.4k
- Fork
- 442
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Overview:
I'm using the "lua-language-server" plugin and encountering an issue with class inheritance notation. The inheritance is performed using the syntax class("DemoComp", require("BaseComp")).
Problem Description:
The issue lies in the way "lua-language-server" handles the require function within the class inheritance context. Despite configuring the "Lua.runtime.special" settings, the plugin does not provide accurate hints for classes defined this way. This is because require requires the script path as its first parameter to function properly, making the standard configuration ineffective.
Desired Solution:
I'd like to suggest enhancing the "lua-language-server" plugin's ability to correctly parse and provide class name hints even in cases where class inheritance is written in the form of class("DemoComp", require("BaseComp")).
Suggested Approach:
To achieve this, the plugin could be designed to recognize and parse the parameters of the require function, allowing it to accurately determine the base class in class inheritance scenarios involving require.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non viene indicato alcun file sorgente o test. Inizia tracciando il modo in cui Lua.runtime.special gestisce i parametri di require e come vengono ricavati i suggerimenti sull’ereditarietà delle classi per class("DemoComp", require("BaseComp")); il lavoro è completo quando il server del linguaggio identifica il modulo richiesto come classe base e fornisce suggerimenti accurati sul nome della classe.
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