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

Add environment support #84

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add environment support #84

wants to merge 3 commits into from

Conversation

JohnnyMorganz
Copy link
Owner

Adds support for type environments.

Environments can now be configured using luau-lsp.types.environments and luau-lsp.types.environmentGlobs.
You can create an environment name and point it to a definitions file, then assign an environment to a glob.

This is useful e.g. by creating a "testez" environment, only applicable to "*.spec.lua". TestEZ related global types will then only be available in those particular files, and will not pollute the global types.

In future, the environment name will be used for documentation parsing.

This extends onwards from #29

luau-lsp.types.definitionFiles has been deprecated in favour of environments. Assign the glob "*" to a global environment.

Blocked on luau-lang/luau#610

@JohnnyMorganz
Copy link
Owner Author

This feature is currently blocked on the following:

We modify typeCheckerForAutocomplete to provide more expressive DM types not present in the base type checker (which AIUI Studio does as well). For environment scopes though, there is no differentiation between the two so we can't do this. Environment scopes only build off the base typeChecker global scope

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Register extra definition files depending on file
1 participant