You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project has some strict styling, and what we have is a system where:
MyClass is the sole returned class in myclass.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.)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
My project has some strict styling, and what we have is a system where:
MyClass
is the sole returned class inmyclass.lua
, annotated and everythinglocal 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 aslocal MyClass = import("src.myclass")
rather thanmyclass
.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.)
The text was updated successfully, but these errors were encountered: