Skip to content

Commit f73af0e

Browse files
committed
Fix dependency
1 parent eb51ecc commit f73af0e

5 files changed

Lines changed: 7 additions & 16 deletions

File tree

Core/Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ let package = Package(
107107
dependencies: [
108108
"ActiveApplicationMonitor",
109109
"AXExtension",
110-
"SuggestionService",
110+
.product(name: "Preferences", package: "Tool"),
111111
]
112112
),
113113

@@ -256,6 +256,7 @@ let package = Package(
256256
name: "XcodeInspector",
257257
dependencies: [
258258
"AXExtension",
259+
"SuggestionModel",
259260
"Environment",
260261
"AXNotificationStream",
261262
.product(name: "Logger", package: "Tool"),
@@ -289,6 +290,7 @@ let package = Package(
289290
"LanguageClient",
290291
"SuggestionModel",
291292
"KeychainAccess",
293+
"XcodeInspector",
292294
.product(name: "Preferences", package: "Tool"),
293295
.product(name: "Terminal", package: "Tool"),
294296
]

Core/Sources/Environment/Environment.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ import ActiveApplicationMonitor
22
import AppKit
33
import AXExtension
44
import Foundation
5-
import GitHubCopilotService
65
import Logger
7-
import SuggestionService
6+
import Preferences
87

98
public struct NoAccessToAccessibilityAPIError: Error, LocalizedError {
109
public var errorDescription: String? {
@@ -134,13 +133,6 @@ public enum Environment {
134133
}
135134
}
136135

137-
public static var createSuggestionService: (
138-
_ projectRootURL: URL,
139-
_ onServiceLaunched: @escaping (SuggestionServiceType) -> Void
140-
) -> SuggestionServiceType = { projectRootURL, onServiceLaunched in
141-
SuggestionService(projectRootURL: projectRootURL, onServiceLaunched: onServiceLaunched)
142-
}
143-
144136
public static var triggerAction: (_ name: String) async throws -> Void = { name in
145137
guard let activeXcode = ActiveApplicationMonitor.activeXcode
146138
?? ActiveApplicationMonitor.latestXcode

Core/Sources/Service/Workspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ final class Workspace {
135135
}
136136

137137
if _suggestionService == nil {
138-
_suggestionService = Environment.createSuggestionService(projectRootURL) {
138+
_suggestionService = SuggestionService(projectRootURL: projectRootURL) {
139139
[weak self] _ in
140140
guard let self else { return }
141141
for (_, filespace) in filespaces {

Core/Tests/ServiceTests/Environment.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ import XPCShared
2222
URL(fileURLWithPath: "/path/to/project/file.swift")
2323
}
2424

25-
Environment.createSuggestionService = {
26-
_, _ in fatalError("")
27-
}
28-
2925
Environment.triggerAction = { _ in }
3026
}
3127

Tool/Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ let package = Package(
1515
],
1616
dependencies: [
1717
.package(url: "https://github.com/pvieito/PythonKit.git", branch: "master"),
18+
// TODO: Switch to Tiktoken. https://github.com/aespinilla/Tiktoken
1819
.package(url: "https://github.com/alfianlosari/GPTEncoder", from: "1.0.4"),
1920
.package(url: "https://github.com/apple/swift-async-algorithms", from: "0.1.0"),
2021
.package(url: "https://github.com/pointfreeco/swift-parsing", from: "0.12.1")
@@ -56,9 +57,9 @@ let package = Package(
5657
.target(
5758
name: "OpenAIService",
5859
dependencies: [
59-
"GPTEncoder",
6060
"Logger",
6161
"Preferences",
62+
.product(name: "GPTEncoder", package: "GPTEncoder"),
6263
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
6364
]
6465
),

0 commit comments

Comments
 (0)