forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphicalUserInterfaceController.swift.swift
More file actions
30 lines (29 loc) · 1.09 KB
/
GraphicalUserInterfaceController.swift.swift
File metadata and controls
30 lines (29 loc) · 1.09 KB
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
26
27
28
29
30
import AppKit
import Environment
import SuggestionWidget
@MainActor
public final class GraphicalUserInterfaceController {
public nonisolated static let shared = GraphicalUserInterfaceController()
nonisolated let realtimeSuggestionIndicatorController = RealtimeSuggestionIndicatorController()
nonisolated let suggestionWidget = SuggestionWidgetController()
private nonisolated init() {
Task { @MainActor in
suggestionWidget.dataSource = WidgetDataSource.shared
suggestionWidget.onOpenChatClicked = {
Task {
let commandHandler = WindowBaseCommandHandler()
_ = try await commandHandler.chatWithSelection(editor: .init(
content: "",
lines: [],
uti: "",
cursorPosition: .outOfScope,
selections: [],
tabSize: 0,
indentSize: 0,
usesTabsForIndentation: false
))
}
}
}
}
}