Skip to content

Commit 000a566

Browse files
authored
Fix SwiftPMWorkspace compatibility with targetMap keys (swiftlang#1025)
`ResolvedTarget` is no longer `Hashable` in SwiftPM, SourceKit-LSP should use `ResolvedTarget.ID` instead. Depends on swiftlang/swift-package-manager#7248.
1 parent 3e432c4 commit 000a566

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SKSwiftPMWorkspace/SwiftPMWorkspace.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ extension SwiftPMWorkspace {
224224
self.fileToTarget = [AbsolutePath: TargetBuildDescription](
225225
packageGraph.allTargets.flatMap { target in
226226
return target.sources.paths.compactMap {
227-
guard let td = plan.targetMap[target] else {
227+
guard let td = plan.targetMap[target.id] else {
228228
return nil
229229
}
230230
return (key: $0, value: td)
@@ -238,7 +238,7 @@ extension SwiftPMWorkspace {
238238

239239
self.sourceDirToTarget = [AbsolutePath: TargetBuildDescription](
240240
packageGraph.allTargets.compactMap { target in
241-
guard let td = plan.targetMap[target] else {
241+
guard let td = plan.targetMap[target.id] else {
242242
return nil
243243
}
244244
return (key: target.sources.root, value: td)

0 commit comments

Comments
 (0)