-
Notifications
You must be signed in to change notification settings - Fork 314
Migrate SwiftLanguageServer
and ClangLanguageServerShim
to be actors
#834
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
Merged
ahoppen
merged 7 commits into
swiftlang:main
from
ahoppen:ahoppen/toolchain-language-servers-actor
Sep 28, 2023
Merged
Migrate SwiftLanguageServer
and ClangLanguageServerShim
to be actors
#834
ahoppen
merged 7 commits into
swiftlang:main
from
ahoppen:ahoppen/toolchain-language-servers-actor
Sep 28, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
395f1ca
to
67bc93f
Compare
hamishknight
approved these changes
Sep 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
This is a preparation step for making `SwiftLanguageServer` and `ClangLanguageServerShim` actors.
…build settings Instead of storing build settings inside the language servers based on update notifications from the build system, always call into the `BuildSystemManager` to get the build settings. Overall, I think this is a much clearer separation of concerns and will allow us to remove `SourceKitServer.documentToPendingQueue` in a follow-up commit as `SwiftLanguageServer` can always directly call into `BuildSystemManager` to get build settings and we don’t need to wait for the initial notification to receive the first build settings. This requies `BuildServerBuildSystem` to keep track of the build settings it has received from the BSP server. `ClangLanguageServer` still caches build settings locally. `ClangLanguageServer` will change to the same pull-based model in a follow-up commit.
Fairly straightforward since we have all the infrastructure now.
…get build settings The same kind of change that we did for `SwiftLanguageServer`. Instead of caching build settings inside `ClangLanguageServerShim`, always call into `BuildSystemManager` to get the build settings.
216a860
to
729c18d
Compare
SwiftLanguageServer
and ClangLanguageServerShim
to be actors 🚥 #830SwiftLanguageServer
and ClangLanguageServerShim
to be actors
…o be connected again
729c18d
to
aaa9bd4
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The next step to making sourcekit-lsp use Swift concurrency.
I think the best way to review this, is commit by commit, ignoring whitespace-only changes because I changed the indentation of quite a few lines if e.g.
queue.async
becomes unnecessary since the function is nowasync
itself.After this change, there are a few low-probability race conditions in the code as well as things to clean up. Those are marked with
FIXME: (async)
. I will fix all of them in follow-up PRs. I’m splitting them to keep the reviews manageable.For reference, my full stack of asyncifying commits is in https://github.com/ahoppen/sourcekit-lsp/tree/ahoppen/swift-concurrency-4.