Skip to content

Commit 9c6fd98

Browse files
committed
Use Void over () on SourceKit files.
1 parent 3cfa9f1 commit 9c6fd98

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Sources/SourceKit/DocumentManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public final class DocumentManager {
9595
/// - returns: The contents of the file after all the edits are applied.
9696
/// - throws: Error.missingDocument if the document is not open.
9797
@discardableResult
98-
public func edit(_ url: URL, newVersion: Int, edits: [TextDocumentContentChangeEvent], editCallback: ((_ before: DocumentSnapshot, TextDocumentContentChangeEvent) -> ())? = nil) throws -> DocumentSnapshot {
98+
public func edit(_ url: URL, newVersion: Int, edits: [TextDocumentContentChangeEvent], editCallback: ((_ before: DocumentSnapshot, TextDocumentContentChangeEvent) -> Void)? = nil) throws -> DocumentSnapshot {
9999
return try queue.sync {
100100
guard let document = documents[url] else {
101101
throw Error.missingDocument(url)
@@ -159,7 +159,7 @@ extension DocumentManager {
159159

160160
/// Convenience wrapper for `edit(_:newVersion:edits:editCallback:)` that logs on failure.
161161
@discardableResult
162-
func edit(_ note: Notification<DidChangeTextDocument>, editCallback: ((_ before: DocumentSnapshot, TextDocumentContentChangeEvent) -> ())? = nil) -> DocumentSnapshot? {
162+
func edit(_ note: Notification<DidChangeTextDocument>, editCallback: ((_ before: DocumentSnapshot, TextDocumentContentChangeEvent) -> Void)? = nil) -> DocumentSnapshot? {
163163
return orLog("failed to edit document", level: .error) {
164164
try edit(note.params.textDocument.url, newVersion: note.params.textDocument.version ?? -1, edits: note.params.contentChanges, editCallback: editCallback)
165165
}

Sources/SourceKit/SourceKitServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final class SourceKitServer: LanguageServer {
7171
}
7272

7373
func registerWorkspaceRequest<R>(
74-
_ requestHandler: @escaping (SourceKitServer) -> (Request<R>, Workspace) -> ())
74+
_ requestHandler: @escaping (SourceKitServer) -> (Request<R>, Workspace) -> Void)
7575
{
7676
_register { [unowned self] (req: Request<R>) in
7777
guard let workspace = self.workspace else {
@@ -83,7 +83,7 @@ public final class SourceKitServer: LanguageServer {
8383
}
8484

8585
func registerWorkspaceNotfication<N>(
86-
_ noteHandler: @escaping (SourceKitServer) -> (Notification<N>, Workspace) -> ())
86+
_ noteHandler: @escaping (SourceKitServer) -> (Notification<N>, Workspace) -> Void)
8787
{
8888
_register { [unowned self] (note: Notification<N>) in
8989
guard let workspace = self.workspace else {

Sources/SourceKit/sourcekitd/SwiftSourceKitFramework.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ extension SwiftSourceKitFramework {
160160
}
161161

162162
/// Send the given request and synchronously receive a reply dictionary (or error).
163-
func send(_ req: SKRequestDictionary, reply: @escaping (LSPResult<SKResponseDictionary>) -> ()) -> sourcekitd_request_handle_t? {
163+
func send(_ req: SKRequestDictionary, reply: @escaping (LSPResult<SKResponseDictionary>) -> Void) -> sourcekitd_request_handle_t? {
164164
logAsync { _ in req.description }
165165

166166
var handle: sourcekitd_request_handle_t? = nil

0 commit comments

Comments
 (0)