File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ]
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ import ActiveApplicationMonitor
22import AppKit
33import AXExtension
44import Foundation
5- import GitHubCopilotService
65import Logger
7- import SuggestionService
6+ import Preferences
87
98public 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
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) ,
You can’t perform that action at this time.
0 commit comments