Skip to content

Commit 874ae39

Browse files
committed
Fix typo
1 parent 9ea8513 commit 874ae39

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Core/Sources/Service/SuggestionCommandHandler/CommentBaseCommandHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import SuggestionInjector
55
import XPCShared
66

77
@ServiceActor
8-
struct CommentBaseCommandHandler: SuggestionCommandHanlder {
8+
struct CommentBaseCommandHandler: SuggestionCommandHandler {
99
nonisolated init() {}
1010

1111
func presentSuggestions(editor: EditorContent) async throws -> UpdatedContent? {

Core/Sources/Service/SuggestionCommandHandler/SuggestionCommandHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import CopilotModel
22
import XPCShared
33

4-
protocol SuggestionCommandHanlder {
4+
protocol SuggestionCommandHandler {
55
@ServiceActor
66
func presentSuggestions(editor: EditorContent) async throws -> UpdatedContent?
77
@ServiceActor

Core/Sources/Service/SuggestionCommandHandler/WindowBaseCommandHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import SuggestionInjector
66
import XPCShared
77

88
@ServiceActor
9-
struct WindowBaseCommandHandler: SuggestionCommandHanlder {
9+
struct WindowBaseCommandHandler: SuggestionCommandHandler {
1010
nonisolated init() {}
1111

1212
let presenter = PresentInWindowSuggestionPresenter()

Core/Sources/Service/XPCService.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class XPCService: NSObject, XPCServiceProtocol {
101101
isRealtimeSuggestionRelatedCommand: Bool = false,
102102
withReply reply: @escaping (Data?, Error?) -> Void,
103103
getUpdatedContent: @escaping @ServiceActor (
104-
SuggestionCommandHanlder,
104+
SuggestionCommandHandler,
105105
EditorContent
106106
) async throws -> UpdatedContent?
107107
) -> Task<Void, Never> {
@@ -112,18 +112,20 @@ public class XPCService: NSObject, XPCServiceProtocol {
112112
rawValue: UserDefaults.shared
113113
.integer(forKey: SettingsKey.suggestionPresentationMode)
114114
) ?? .comment
115-
let handler: SuggestionCommandHanlder = {
115+
let handler: SuggestionCommandHandler = {
116116
switch mode {
117117
case .comment:
118118
return CommentBaseCommandHandler()
119119
case .floatingWidget:
120120
return WindowBaseCommandHandler()
121121
}
122122
}()
123+
try Task.checkCancellation()
123124
guard let updatedContent = try await getUpdatedContent(handler, editor) else {
124125
reply(nil, nil)
125126
return
126127
}
128+
try Task.checkCancellation()
127129
reply(try JSONEncoder().encode(updatedContent), nil)
128130
} catch {
129131
os_log(.error, "%@", "\(file):\(line) \(error.localizedDescription)")

0 commit comments

Comments
 (0)