tests: Remove global builtins state #1134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Built ins must now be provided by the caller.
We have been having a number of issues with race conditions in tests where the shared list of builtins was required to be in a different state in different tests. Namely, the single file language server test that updated the config to use a different caps list, and inlay hints which was also based on this data.
After some consideration, it appears to make sense that the built ins, being related to the loaded caps, should be provided when required, rather than being fetched from the global state. This means that the code requiring builtins can continue to operate while needing know knowledge of what the builtins list should be, as that is now a concern of the caller.
I have added field on the server to store the state of builtins for different caps versions which we can use to pass down a list of builtins from when needed in the various server functions.
Related
#1101
#1102
#1112
#1121
#1129