File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -10,19 +10,12 @@ public final class GraphicalUserInterfaceController {
1010 private nonisolated init ( ) {
1111 Task { @MainActor in
1212 suggestionWidget. dataSource = WidgetDataSource . shared
13- suggestionWidget. onOpenChatClicked = {
13+ suggestionWidget. onOpenChatClicked = { [ weak self ] in
1414 Task {
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- ) )
15+ let uri = try await Environment . fetchFocusedElementURI ( )
16+ let dataSource = WidgetDataSource . shared
17+ await dataSource. createChatIfNeeded ( for: uri)
18+ self ? . suggestionWidget. presentChatRoom ( fileURL: uri)
2619 }
2720 }
2821 suggestionWidget. onCustomCommandClicked = { command in
You can’t perform that action at this time.
0 commit comments