-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add two Sendable annotations to enable building SourceKit-LSP in Swift 6 mode #7559
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
Add two Sendable annotations to enable building SourceKit-LSP in Swift 6 mode #7559
Conversation
This allows us to build `SourceKitLSP` in Swift 6 mode.
This allows us to build `SourceKitLSP` in Swift 6 mode.
// This is not just a computed property because the ToolchainRegistryTests | ||
// change the value. |
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.
I assume this comment wasn't true 😅? If that's the case though, can it just be a computed property?
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.
It was, ToolchainRegistryTests
is in SourceKit-LSP: swiftlang/sourcekit-lsp#1276 (comment)
I prefer it to be stored so we don’t re-run uname
every time the variable is accessed.
@@ -563,7 +563,7 @@ public struct TargetSourcesBuilder { | |||
} | |||
|
|||
/// Describes a rule for including a source or resource file in a target. | |||
public struct FileRuleDescription { | |||
public struct FileRuleDescription: Sendable { |
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.
Don't we need FileRuleDescription.Rule
to conform to Sendable
?
Because it is public.
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.
This change is trying to be minimal to get SourceKit-LSP building in Swift 6 mode. Adding proper Sendable
annotations to SwiftPM wherever sensible is not a goal of this PR.
@swift-ci Please test |
@swift-ci Please test Linux |
FileRuleDescription
andPlatform
asSendable
and makePlatform.current
a constant. This allows us to build SourceKit-LSP in Swift 6 modeFileRuleDescription
andPlatform
if SwiftPM is used as a librarySendable
conformances is safe and I don’t expect anyone to modifyPlatform.current
Sendable
annotations to enable building SourceKit-LSP in Swift 6 mode #7553