Migrate to SwiftExtensions API in swift-tools-protocols#2686
Conversation
4bfe120 to
3f10a02
Compare
|
swiftlang/swift-tools-protocols#65 |
|
swiftlang/swift-tools-protocols#65 |
1 similar comment
|
swiftlang/swift-tools-protocols#65 |
3f10a02 to
1a99032
Compare
|
swiftlang/swift-tools-protocols#65 |
|
swiftlang/swift-tools-protocols#65 |
2 similar comments
|
swiftlang/swift-tools-protocols#65 |
|
swiftlang/swift-tools-protocols#65 |
|
swiftlang/swift-tools-protocols#65 |
| return Double(self.components.attoseconds) / 1_000_000_000_000_000_000 + Double(self.components.seconds) | ||
| } | ||
| } | ||
| @_exported @_spi(SourceKitLSP) public import ToolsProtocolsSwiftExtensions |
There was a problem hiding this comment.
Do we really want to use @_exported? Re-exporting symbols always feels a bit like a hack to me and it’s not really needed here. We could just import ToolsProtocolsSwiftExtensions wherever it’s used.
There was a problem hiding this comment.
Do we really want to use
@_exported?
Not "really", but IMO adding @_spi(SourceKitLSP) import ToolsProtocolsSwiftExtensions everywhere doesn't benefit anything.
By @_exported (the second commit) We can save 93 (+124 -217) lines of code.
There was a problem hiding this comment.
My main thought is just that once we start with @_exported, where do we stop. Surely we can remove a bunch of imports if we make SourceKitLSP export SwiftExtensions as well.
There was a problem hiding this comment.
Okay, removed the second commit 👍
1a99032 to
fd9fd7a
Compare
Delete `Collection+Only.swift`, `Duration+Seconds.swift`, `FileManagerExtensions.swift`, `PipeAsStringHandler.swift`, and `URLExtensions.swift` from `Sources/SwiftExtensions/`. The same APIs now live in swift-tools-protocols as `@_spi(SourceKitLSP) public` declarations. Update each call site to add `@_spi(SourceKitLSP) import ToolsProtocolsSwiftExtensions` next to the existing `import SwiftExtensions`. Add the `_ToolsProtocolsSwiftExtensionsForPlugin` dependency and the `ToolsProtocolsSwiftExtensions=_ToolsProtocolsSwiftExtensionsForPlugin` module alias to the `SwiftSourceKitClientPlugin` target in both `Package.swift` and the corresponding `CMakeLists.txt`.
fd9fd7a to
b9e4c67
Compare
|
swiftlang/swift-tools-protocols#65 |
|
swiftlang/swift-tools-protocols#65 |
Update for swiftlang/swift-tools-protocols#65
Delete duplicated implementations from SwiftExtensions. The same APIs now live in swift-tools-protocols as
@_spi(SourceKitLSP) publicdeclarations.