Skip to content

Commit 360f88b

Browse files
committed
Use Void over () on SKTestSupport files.
1 parent 1ff465d commit 360f88b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Sources/SKTestSupport/CheckCoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public func checkDecoding<T>(json: String, expected value: T, file: StaticString
6767
XCTAssertEqual(value, decodedValue, file: file, line: line)
6868
}
6969

70-
public func checkCoding<T>(_ value: T, json: String, userInfo: [CodingUserInfoKey: Any] = [:], file: StaticString = #file, line: UInt = #line, body: (T) -> ()) where T: Codable {
70+
public func checkCoding<T>(_ value: T, json: String, userInfo: [CodingUserInfoKey: Any] = [:], file: StaticString = #file, line: UInt = #line, body: (T) -> Void) where T: Codable {
7171
let encoder = JSONEncoder()
7272
encoder.outputFormatting.insert(.prettyPrinted)
7373
if #available(macOS 10.13, *) {

Sources/SKTestSupport/TestJSONRPCConnection.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ public final class TestClient: LanguageServerEndpoint {
9393
}
9494

9595
public var replyQueue: DispatchQueue = DispatchQueue(label: "testclient-reply-queue")
96-
var oneShotNotificationHandlers: [((Any) -> ())] = []
96+
var oneShotNotificationHandlers: [((Any) -> Void)] = []
9797

9898
public var allowUnexpectedNotification: Bool = false
9999

100-
public func appendOneShotNotificationHandler<N>(_ handler: @escaping (Notification<N>) -> ()) {
100+
public func appendOneShotNotificationHandler<N>(_ handler: @escaping (Notification<N>) -> Void) {
101101
oneShotNotificationHandlers.append({ anyNote in
102102
guard let note = anyNote as? Notification<N> else {
103103
fatalError("received notification of the wrong type \(anyNote); expected \(N.self)")
@@ -106,7 +106,7 @@ public final class TestClient: LanguageServerEndpoint {
106106
})
107107
}
108108

109-
public func handleNextNotification<N>(_ handler: @escaping (Notification<N>) -> ()) {
109+
public func handleNextNotification<N>(_ handler: @escaping (Notification<N>) -> Void) {
110110
precondition(oneShotNotificationHandlers.isEmpty)
111111
appendOneShotNotificationHandler(handler)
112112
}
@@ -137,12 +137,12 @@ extension TestClient: Connection {
137137
}
138138

139139
/// 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 {
141141
return server.send(request, queue: queue, reply: reply)
142142
}
143143

144144
/// 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 {
146146
return send(request, queue: replyQueue, reply: reply)
147147
}
148148

@@ -152,7 +152,7 @@ extension TestClient: Connection {
152152

153153
/// Send a notification and expect a notification in reply synchronously.
154154
/// 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 {
156156

157157
let expectation = XCTestExpectation(description: "sendNoteSync - note received")
158158

@@ -173,8 +173,8 @@ extension TestClient: Connection {
173173
/// For testing notifications that behave like requests - e.g. didChange & publishDiagnostics.
174174
public func sendNoteSync<NSend, NReply1, NReply2>(
175175
_ notification: NSend,
176-
_ handler1: @escaping (Notification<NReply1>) -> (),
177-
_ handler2: @escaping (Notification<NReply2>) -> ()
176+
_ handler1: @escaping (Notification<NReply1>) -> Void,
177+
_ handler2: @escaping (Notification<NReply2>) -> Void
178178
) where NSend: NotificationType {
179179

180180
let expectation = XCTestExpectation(description: "sendNoteSync - note received")

0 commit comments

Comments
 (0)