@@ -2,19 +2,22 @@ import AppKit
22import CopilotService
33import Foundation
44import LanguageServerProtocol
5+ import XPCShared
56
67@globalActor enum ServiceActor {
78 public actor TheActor { }
89 public static let shared = TheActor ( )
910}
1011
11- class XPCService : NSObject , XPCServiceProtocol {
12+ public class XPCService : NSObject , XPCServiceProtocol {
1213 @ServiceActor
1314 lazy var authService : CopilotAuthServiceType = Environment . createAuthService ( )
1415 @ServiceActor
1516 var workspaces = [ URL: Workspace] ( )
1617
17- func checkStatus( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
18+ override public init ( ) { }
19+
20+ public func checkStatus( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
1821 Task { @ServiceActor in
1922 do {
2023 let status = try await authService. checkStatus ( )
@@ -25,7 +28,7 @@ class XPCService: NSObject, XPCServiceProtocol {
2528 }
2629 }
2730
28- func signInInitiate( withReply reply: @escaping ( String ? , String ? , Error ? ) -> Void ) {
31+ public func signInInitiate( withReply reply: @escaping ( String ? , String ? , Error ? ) -> Void ) {
2932 Task { @ServiceActor in
3033 do {
3134 let ( verificationLink, userCode) = try await authService. signInInitiate ( )
@@ -36,7 +39,7 @@ class XPCService: NSObject, XPCServiceProtocol {
3639 }
3740 }
3841
39- func signInConfirm( userCode: String , withReply reply: @escaping ( String ? , String ? , Error ? ) -> Void ) {
42+ public func signInConfirm( userCode: String , withReply reply: @escaping ( String ? , String ? , Error ? ) -> Void ) {
4043 Task { @ServiceActor in
4144 do {
4245 let ( username, status) = try await authService. signInConfirm ( userCode: userCode)
@@ -47,7 +50,7 @@ class XPCService: NSObject, XPCServiceProtocol {
4750 }
4851 }
4952
50- func getVersion( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
53+ public func getVersion( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
5154 Task { @ServiceActor in
5255 do {
5356 let version = try await authService. version ( )
@@ -58,7 +61,7 @@ class XPCService: NSObject, XPCServiceProtocol {
5861 }
5962 }
6063
61- func signOut( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
64+ public func signOut( withReply reply: @escaping ( String ? , Error ? ) -> Void ) {
6265 Task { @ServiceActor in
6366 do {
6467 let status = try await authService. signOut ( )
@@ -69,7 +72,7 @@ class XPCService: NSObject, XPCServiceProtocol {
6972 }
7073 }
7174
72- func getSuggestedCode(
75+ public func getSuggestedCode(
7376 editorContent: Data ,
7477 withReply reply: @escaping ( Data ? , Error ? ) -> Void
7578 ) {
@@ -98,7 +101,7 @@ class XPCService: NSObject, XPCServiceProtocol {
98101 }
99102 }
100103
101- func getNextSuggestedCode(
104+ public func getNextSuggestedCode(
102105 editorContent: Data ,
103106 withReply reply: @escaping ( Data ? , Error ? ) -> Void
104107 ) {
@@ -123,7 +126,7 @@ class XPCService: NSObject, XPCServiceProtocol {
123126 }
124127 }
125128
126- func getPreviousSuggestedCode(
129+ public func getPreviousSuggestedCode(
127130 editorContent: Data ,
128131 withReply reply: @escaping ( Data ? , Error ? ) -> Void
129132 ) {
@@ -148,7 +151,7 @@ class XPCService: NSObject, XPCServiceProtocol {
148151 }
149152 }
150153
151- func getSuggestionRejectedCode(
154+ public func getSuggestionRejectedCode(
152155 editorContent: Data ,
153156 withReply reply: @escaping ( Data ? , Error ? ) -> Void
154157 ) {
@@ -173,7 +176,7 @@ class XPCService: NSObject, XPCServiceProtocol {
173176 }
174177 }
175178
176- func getSuggestionAcceptedCode(
179+ public func getSuggestionAcceptedCode(
177180 editorContent: Data ,
178181 withReply reply: @escaping ( Data ? , Error ? ) -> Void
179182 ) {
0 commit comments