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

Cleanup serverstate and project #187

Merged
merged 9 commits into from
Jan 17, 2025

Conversation

milesziemer
Copy link
Contributor

@milesziemer milesziemer commented Jan 17, 2025

Various refactoring commits that clean up ServerState and Project. Exposing the fields of ServerState made it super annoying to refactor, so I made ServerState a class and hid everything. Then, I was able to make ServerState only store one collection of projects, and handle its own mutations. Similar story for Project.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@milesziemer milesziemer requested a review from a team as a code owner January 17, 2025 17:26
@milesziemer milesziemer requested review from JordonPhillips and yefrig and removed request for JordonPhillips January 17, 2025 17:26
/**
* Provides access to {@link Document}s managed by the server.
*
* <p>A document is _managed_ if its state is controlled by the lifecycle methods
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if

is a separator then maybe keep it on its own line

When loading a project, SmithyFiles were being read from disk multiple
times. This commit refactors ProjectLoader to only read from disk once,
and also cleans up some stuff.
Project loading can now depend on a single interface that provides
access to managed files, rather than ServerState itself.
@milesziemer milesziemer merged commit 1e48800 into smithy-lang:main Jan 17, 2025
3 checks passed
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