@@ -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