-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make more generic for non-Roblox use cases #40
Comments
We can definitely add support for string based requires (I think we should already have basic support for requiring string paths using What kind of things do you need support for from a require perspective? Is (relative/absolute) string path requires sufficient for your use case?
I'm thinking from the LSP perspective to allow users to pass in paths to definitions files which we will load (#29 - maybe also have a general "global" types configuration too). Support is actually already there, it just hasn't been exposed yet. By default we load in a Roblox definition file, so we should also add an option to disable this. I actually forked luau-analyze with support to specify any definition files in the command line. If you install the binary from releases, you can then run the following (still currently named
The original tool was made at https://github.com/JohnnyMorganz/luau-analyze-rojo, but it was later merged into this project (to simplify maintenance). The README in that project should provide some more information, but it is also briefly mentioned at https://github.com/JohnnyMorganz/luau-lsp#standalone.
I think OO types are just a general Luau thing, so any support for this will be necessary from the Luau side. There is this example: https://luau-lang.org/typecheck#typing-idiomatic-oop, not sure if it applies in your scenario too.
The LSP should actually work without Rojo! You might get some warnings right now (we should probably have a config option to disable these), but the LSP should still be usable.
Definitely open to other editors. I only use VSCode so not sure how language client integrations work with something like Sublime, but if anyone's interested, I'm happy to accept and maintain any language client contributions in the Overall, I think generic support is definitely possible, just very primitive right now - need to move some things so they are conditionally registered, but the Roblox/Rojo references can probably be ignored right now and the LSP still usable. I was thinking about maybe an overall setting to define what kind of ecosystem is being used, and guard behind that check. Still need to investigate that a bit more. |
Ah, I didn't realize this should "just work" (with some possible warnings) even without Rojo! I installed it just now directly from VS Code's extension manager, and things look promising so far.
Just relative would be great. I can confirm that
#29 looks perfect for this, thanks. It'll help a lot. Is there some other way to force luau-lsp to load a definitions file so I don't have to run
Confirmed. Suggestion: consider "inverting" the README so it focuses on instructions for using vanilla Luau. And then add a section for anyone using it with Roblox/Rojo/etc.
You're right, this is probably more a discussion about their docs. In case anyone here has suggestions, my issues with the docs you linked are:
...in order for luau-lsp to work. Ideally we could use
Thanks for the reply, super helpful, and I look forward to ongoing improvements in this direction. |
Agreed with this, the README does make it sound very Roblox specific/vanilla support isn't available
This is unfortunately a Luau constraint right now, which zeux discussed during his stream about |
I think everything brought up in this issue is supported now (apart from other editors - created a new issue at #50) I'm going to close this, but if there is still places where we lack generic support, feel free to re-open or create a new issue |
I'm using Luau outside of Roblox. My top problems with this (in terms of LSP-related issues) are:
require
that Luau gives us doesn't work outside Roblox. Until this is fixed in Luau, I'm using a customrequire
. It takes a string that is a script name without its file extension. Sadly this breaks exported types because luau-analyze doesn't know what to do. Since it may take a while forrequire
to be fixed, some interim solution for this would be great.I know some of these may not make sense to solve in luau-lsp, and maybe in some cases I'm just missing something, but thought I'd share in case anyone has suggestions and/or it's helpful to others.
The text was updated successfully, but these errors were encountered: