Skip to content

Commit 7895aeb

Browse files
committed
Ignore command cancellation error
1 parent 2c9f327 commit 7895aeb

8 files changed

+16
-0
lines changed

EditorExtension/AcceptSuggestionCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ class AcceptSuggestionCommand: NSObject, XCSourceEditorCommand, CommandType {
2020
invocation.accept(content)
2121
}
2222
completionHandler(nil)
23+
} catch is CancellationError {
24+
completionHandler(nil)
2325
} catch {
2426
completionHandler(error)
2527
}

EditorExtension/GetSuggestionsCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class GetSuggestionsCommand: NSObject, XCSourceEditorCommand, CommandType {
1919
invocation.accept(content)
2020
}
2121
completionHandler(nil)
22+
} catch is CancellationError {
23+
completionHandler(nil)
2224
} catch {
2325
completionHandler(error)
2426
}

EditorExtension/NextSuggestionCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class NextSuggestionCommand: NSObject, XCSourceEditorCommand, CommandType {
1919
invocation.accept(content)
2020
}
2121
completionHandler(nil)
22+
} catch is CancellationError {
23+
completionHandler(nil)
2224
} catch {
2325
completionHandler(error)
2426
}

EditorExtension/PreviousSuggestionCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class PreviousSuggestionCommand: NSObject, XCSourceEditorCommand, CommandType {
1919
invocation.accept(content)
2020
}
2121
completionHandler(nil)
22+
} catch is CancellationError {
23+
completionHandler(nil)
2224
} catch {
2325
completionHandler(error)
2426
}

EditorExtension/RealtimeSuggestionCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class RealtimeSuggestionsCommand: NSObject, XCSourceEditorCommand, CommandType {
1919
invocation.accept(content)
2020
}
2121
completionHandler(nil)
22+
} catch is CancellationError {
23+
completionHandler(nil)
2224
} catch {
2325
completionHandler(error)
2426
}

EditorExtension/RejectSuggestionCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class RejectSuggestionCommand: NSObject, XCSourceEditorCommand, CommandType {
1919
invocation.accept(content)
2020
}
2121
completionHandler(nil)
22+
} catch is CancellationError {
23+
completionHandler(nil)
2224
} catch {
2325
completionHandler(error)
2426
}

EditorExtension/TurnOffRealtimeSuggestionsCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class TurnOffRealtimeSuggestionsCommand: NSObject, XCSourceEditorCommand, Comman
1515
let service = try getService()
1616
try await service.setAutoSuggestion(enabled: false)
1717
completionHandler(nil)
18+
} catch is CancellationError {
19+
completionHandler(nil)
1820
} catch {
1921
completionHandler(error)
2022
}

EditorExtension/TurnOnRealtimeSuggestionsCommand.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class TurnOnRealtimeSuggestionsCommand: NSObject, XCSourceEditorCommand, Command
1515
let service = try getService()
1616
try await service.setAutoSuggestion(enabled: true)
1717
completionHandler(nil)
18+
} catch is CancellationError {
19+
completionHandler(nil)
1820
} catch {
1921
completionHandler(error)
2022
}

0 commit comments

Comments
 (0)