Skip to content

Commit a3ffe53

Browse files
committed
Open chat thru command handler
1 parent 4f603e9 commit a3ffe53

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Core/Sources/Service/GUI/GraphicalUserInterfaceController.swift.swift

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ public final class GraphicalUserInterfaceController {
1212
suggestionWidget.dataSource = WidgetDataSource.shared
1313
suggestionWidget.onOpenChatClicked = {
1414
Task {
15-
let fileURL = try await Environment.fetchCurrentFileURL()
16-
await WidgetDataSource.shared.createChatIfNeeded(for: fileURL)
17-
let presenter = PresentInWindowSuggestionPresenter()
18-
presenter.presentChatRoom(fileURL: fileURL)
15+
let commandHandler = WindowBaseCommandHandler()
16+
_ = try await commandHandler.chatWithSelection(editor: .init(
17+
content: "",
18+
lines: [],
19+
uti: "",
20+
cursorPosition: .outOfScope,
21+
selections: [],
22+
tabSize: 0,
23+
indentSize: 0,
24+
usesTabsForIndentation: false
25+
))
1926
}
2027
}
2128
}

0 commit comments

Comments
 (0)