Skip to content
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

Allow specifying type definition files from .luaurc #418

Open
Gargafield opened this issue Mar 11, 2022 · 9 comments
Open

Allow specifying type definition files from .luaurc #418

Gargafield opened this issue Mar 11, 2022 · 9 comments
Labels
enhancement New feature or request roadmap This is on our long-term roadmap

Comments

@Gargafield
Copy link

Gargafield commented Mar 11, 2022

It's currently hard to use Luau analysis with custom libraries or environments.

I propose that the .luaurc file have a field that links to a file with custom type definitions.
These types would of course still use the old format.

@Gargafield Gargafield added the enhancement New feature or request label Mar 11, 2022
@Gargafield Gargafield changed the title Allow for Allow for CostumDefinitions Mar 11, 2022
@zeux zeux changed the title Allow for CostumDefinitions Allow specifying type definition files from .luaurc Mar 11, 2022
@Gargafield
Copy link
Author

This could be done with a global types file path. The file is a lua file with export type statements.

@ross-weir
Copy link

+1

I'm using luau embedded in my app, this would be amazing. At the moment I need to define my custom types as global Any.

@erlend-sh
Copy link

This would also enable doing more of the sort of thing https://github.com/lenscas/tealr is doing.

@makspll
Copy link

makspll commented Jun 27, 2022

+1 on this issue, would perhaps re-using teal project's .d.tl declaration files be a possibility? As soon as declaration files exist I would love to integrate luau into https://github.com/makspll/bevy_mod_scripting

@lenscas
Copy link

lenscas commented Jun 27, 2022

+1 on this issue, would perhaps re-using teal project's .d.tl declaration files be a possibility? As soon as declaration files exist I would love to integrate luau into https://github.com/makspll/bevy_mod_scripting

I believe the author of mlua is already looking into supporting luau. So, all that is needed on your end is a mlua version with that enabled, a luau version that supports something like .d.tl files and a tealr version that can generate whatever luau ends up with.

So.. as someone who only has control of 1 of the 3 things for that, I also do a +1 on this issue :)

@Gargafield
Copy link
Author

I'll try doing a pull request tomorrow.

@Gargafield
Copy link
Author

Well, a week went by and I didn't have time... I promise ill do it.

@makspll
Copy link

makspll commented Jul 4, 2022

@HawDevelopment haha no worries, no pressure!

@Gargafield
Copy link
Author

image
I'll make a pull request once I've cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roadmap This is on our long-term roadmap
Development

No branches or pull requests

6 participants