luau/Analysis
JohnnyMorganz a95dff3223
Pass environment scope to autocomplete typechecker (#610)
Fixes a bug where the environment scope is not passed to the autocomplete typechecker, so environment-related types are not provided.

This caused an issue where `getModuleEnvironment` returns `typeChecker.globalScope` when there is no environment. We pass this through to `typeCheckerForAutocomplete.check()` then environmentscope is no longer nullopt and it will use `typeChecker.globalScope` instead of falling back to `typeCheckerForAutocomplete.globalScope`.

This is solved by passing `forAutocomplete` to `getModuleEnvironment` so it falls back to the autocomplete global scope if none found.
2022-08-23 11:53:02 -07:00
..
include/Luau Pass environment scope to autocomplete typechecker (#610) 2022-08-23 11:53:02 -07:00
src Pass environment scope to autocomplete typechecker (#610) 2022-08-23 11:53:02 -07:00