Skip to content

Commit 1fe28bf

Browse files
author
Sean Henry
committed
Removes unneeded completion call in cancellation handler
1 parent a3a395b commit 1fe28bf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

XcodePlugin/SourceEditorCommand.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@ import XcodeKit
33

44
class SourceEditorCommand: NSObject, XCSourceEditorCommand {
55

6-
var cancelled = false
6+
private var cancelled = false
77
fileprivate lazy var connection: Connection = {
88
let connection = Connection()
99
connection.setUpConnection()
1010
return connection
1111
}()
1212

1313
func perform(with invocation: XCSourceEditorCommandInvocation, completionHandler: @escaping (Error?) -> Void) -> Void {
14-
cancelled = false
1514
invocation.cancellationHandler = { [weak self] in
1615
DispatchQueue.main.async { [weak self] in
1716
self?.cancelled = true
1817
self?.connection.suspendConnection()
19-
self?.finish(with: nil, handler: completionHandler)
2018
}
2119
}
2220
connection.interruptionHandler { [weak self] in

0 commit comments

Comments
 (0)