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

Include a useful definitionModuleName for types originating from definitions file #818

Closed
JohnnyMorganz opened this issue Jan 24, 2023 · 0 comments · Fixed by #861
Closed
Labels
enhancement New feature or request

Comments

@JohnnyMorganz
Copy link
Contributor

Right now, when loading in types from a definitions file, the relevant definitionModuleName for the FunctionType/ClassType etc. is empty. This is because the SourceModule passed to check() in loadDefinitions has no module name set.

It would be useful to have this information populated to understand where a type comes from (and permit operations such as Go To Declaration and documentation comments)

@JohnnyMorganz JohnnyMorganz added the enhancement New feature or request label Jan 24, 2023
@JohnnyMorganz JohnnyMorganz changed the title Include a useful definitionsModuleName for types origination from definitions file Include a useful definitionModuleName for types originating from definitions file Jan 24, 2023
vegorov-rbx pushed a commit that referenced this issue Nov 21, 2023
Closes #818 

We set the `moduleName` of the source module to the provided
`packageName`.
This then populates the relevant `definitionModuleName`'s on
CTV/FTV/TTVs, so it allows us to lookup where they originated from.

The one place I can see this having an impact inside of Luau code is the
following:

https://github.com/Roblox/luau/blob/1fa8311a188a932233d2ce2bc6412e5bab37c035/Analysis/src/Error.cpp#L70-L90
Which will potentially change they way error messages are formatted.
Should there be a way to exclude definition files when calling
`getDefinitionModuleName`, so we can preserve this behaviour?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

1 participant