@@ -93,11 +93,11 @@ public final class TestClient: LanguageServerEndpoint {
93
93
}
94
94
95
95
public var replyQueue : DispatchQueue = DispatchQueue ( label: " testclient-reply-queue " )
96
- var oneShotNotificationHandlers : [ ( ( Any ) -> ( ) ) ] = [ ]
96
+ var oneShotNotificationHandlers : [ ( ( Any ) -> Void ) ] = [ ]
97
97
98
98
public var allowUnexpectedNotification : Bool = false
99
99
100
- public func appendOneShotNotificationHandler< N> ( _ handler: @escaping ( Notification < N > ) -> ( ) ) {
100
+ public func appendOneShotNotificationHandler< N> ( _ handler: @escaping ( Notification < N > ) -> Void ) {
101
101
oneShotNotificationHandlers. append ( { anyNote in
102
102
guard let note = anyNote as? Notification < N > else {
103
103
fatalError ( " received notification of the wrong type \( anyNote) ; expected \( N . self) " )
@@ -106,7 +106,7 @@ public final class TestClient: LanguageServerEndpoint {
106
106
} )
107
107
}
108
108
109
- public func handleNextNotification< N> ( _ handler: @escaping ( Notification < N > ) -> ( ) ) {
109
+ public func handleNextNotification< N> ( _ handler: @escaping ( Notification < N > ) -> Void ) {
110
110
precondition ( oneShotNotificationHandlers. isEmpty)
111
111
appendOneShotNotificationHandler ( handler)
112
112
}
@@ -137,12 +137,12 @@ extension TestClient: Connection {
137
137
}
138
138
139
139
/// Send a request to the language server and (asynchronously) receive a reply.
140
- public func send< Request> ( _ request: Request , queue: DispatchQueue , reply: @escaping ( LSPResult < Request . Response > ) -> ( ) ) -> RequestID where Request: RequestType {
140
+ public func send< Request> ( _ request: Request , queue: DispatchQueue , reply: @escaping ( LSPResult < Request . Response > ) -> Void ) -> RequestID where Request: RequestType {
141
141
return server. send ( request, queue: queue, reply: reply)
142
142
}
143
143
144
144
/// Convenience method to get reply on replyQueue.
145
- public func send< Request> ( _ request: Request , reply: @escaping ( LSPResult < Request . Response > ) -> ( ) ) -> RequestID where Request: RequestType {
145
+ public func send< Request> ( _ request: Request , reply: @escaping ( LSPResult < Request . Response > ) -> Void ) -> RequestID where Request: RequestType {
146
146
return send ( request, queue: replyQueue, reply: reply)
147
147
}
148
148
@@ -152,7 +152,7 @@ extension TestClient: Connection {
152
152
153
153
/// Send a notification and expect a notification in reply synchronously.
154
154
/// For testing notifications that behave like requests - e.g. didChange & publishDiagnostics.
155
- public func sendNoteSync< NSend, NReply> ( _ notification: NSend , _ handler: @escaping ( Notification < NReply > ) -> ( ) ) where NSend: NotificationType {
155
+ public func sendNoteSync< NSend, NReply> ( _ notification: NSend , _ handler: @escaping ( Notification < NReply > ) -> Void ) where NSend: NotificationType {
156
156
157
157
let expectation = XCTestExpectation ( description: " sendNoteSync - note received " )
158
158
@@ -173,8 +173,8 @@ extension TestClient: Connection {
173
173
/// For testing notifications that behave like requests - e.g. didChange & publishDiagnostics.
174
174
public func sendNoteSync< NSend, NReply1, NReply2> (
175
175
_ notification: NSend ,
176
- _ handler1: @escaping ( Notification < NReply1 > ) -> ( ) ,
177
- _ handler2: @escaping ( Notification < NReply2 > ) -> ( )
176
+ _ handler1: @escaping ( Notification < NReply1 > ) -> Void ,
177
+ _ handler2: @escaping ( Notification < NReply2 > ) -> Void
178
178
) where NSend: NotificationType {
179
179
180
180
let expectation = XCTestExpectation ( description: " sendNoteSync - note received " )
0 commit comments