File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,15 @@ public class XPCService: NSObject, XPCServiceProtocol {
246246 }
247247
248248 public func setAutoSuggestion( enabled: Bool , withReply reply: @escaping ( Error ? ) -> Void ) {
249+ struct NoInputMonitoringPermission : Error , LocalizedError {
250+ var errorDescription : String ? {
251+ " Permission for Input Monitoring is not granted to make real-time suggestions work. Please turn in on in System Settings.app and try again later. "
252+ }
253+ }
254+ guard AXIsProcessTrusted ( ) else {
255+ reply ( NoInputMonitoringPermission ( ) )
256+ return
257+ }
249258 Task { @ServiceActor in
250259 let fileURL = try await Environment . fetchCurrentFileURL ( )
251260 let workspace = try await fetchOrCreateWorkspaceIfNeeded ( fileURL: fileURL)
You can’t perform that action at this time.
0 commit comments