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

tests: Remove global builtins state #1134

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

charlieegan3
Copy link
Member

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

@charlieegan3 charlieegan3 force-pushed the no-global-builtins branch 3 times, most recently from deb7f4d to adab423 Compare September 24, 2024 15:48
Built ins must now be provided by the caller.

We have been having a number of issues where the shared list of builtins
was required to be in a different state in different tests.

Related
StyraInc#1101
StyraInc#1102
StyraInc#1112
StyraInc#1121
StyraInc#1129

Signed-off-by: Charlie Egan <charlie@styra.com>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Well done getting our tests fixed up! 👏

@anderseknert anderseknert merged commit ab3b3b8 into StyraInc:main Sep 24, 2024
4 checks passed
@charlieegan3
Copy link
Member Author

I really hope we've seen the back of the inlay hints issue...

@charlieegan3 charlieegan3 deleted the no-global-builtins branch September 24, 2024 16:35
@anderseknert
Copy link
Member

IMG_2009

srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
Built ins must now be provided by the caller.

We have been having a number of issues where the shared list of builtins
was required to be in a different state in different tests.

Related
StyraInc#1101
StyraInc#1102
StyraInc#1112
StyraInc#1121
StyraInc#1129

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this pull request Jan 6, 2025
Built ins must now be provided by the caller.

We have been having a number of issues where the shared list of builtins
was required to be in a different state in different tests.

Related
StyraInc#1101
StyraInc#1102
StyraInc#1112
StyraInc#1121
StyraInc#1129

Signed-off-by: Charlie Egan <charlie@styra.com>
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.

2 participants