forked from github/CopilotForXcode
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOpenChat.swift
More file actions
25 lines (23 loc) · 658 Bytes
/
OpenChat.swift
File metadata and controls
25 lines (23 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Client
import SuggestionBasic
import Foundation
import XcodeKit
class OpenChatCommand: NSObject, XCSourceEditorCommand, CommandType {
var name: String { "Open Chat" }
func perform(
with invocation: XCSourceEditorCommandInvocation,
completionHandler: @escaping (Error?) -> Void
) {
Task {
do {
let service = try getService()
try await service.openChat()
completionHandler(nil)
} catch is CancellationError {
completionHandler(nil)
} catch {
completionHandler(error)
}
}
}
}