LuaLS / LuaLS/lua-language-server
[Feature request] Class-based auto-require
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
My project has some strict styling, and what we have is a system where:
MyClassis the sole returned class inmyclass.lua, annotated and everything- Usage is
local MyClass = import("src.myclass")
The language server has a setting for auto-requires. Unfortunately, it hardcodes the require function & is completely filename based.
I've just opened #3201 to add the import thing, but I'd like to request a setting which makes auto-requires work better with the class names, rather than being filename-based.
Ex. MyClass.something() suggests to require the file as local MyClass = import("src.myclass") rather than myclass.
We've considered either not caring (very ugly for code-style), manually fixing it every time (makes auto-requires kind of useless) or changing the filenames to be cased the same as the class (not a proper solution but a workaround -- one that would make the file structure look worse & fear for case sensitive filesystems)
As far as I can tell, this seems like a language server limitation rather than a design limitation. I would try to contribute this option myself, but this codebase seems too complicated for me to understand unfortunately...
(I just realized I opened a similar request a year ago -- I completely forgot and have closed it now.)
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
Esamina prima l'impostazione auto-require esistente del server del linguaggio e la richiesta correlata #3201. Il lavoro è completato quando i suggerimenti basati sulle classi possono produrre l'istruzione nello stile di import richiesto, invece di basarsi solo sui nomi dei file.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua
- Ambito
- tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100