File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
src/vs/workbench/api/browser Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -440,7 +440,13 @@ export class MainThreadChatSessions extends Disposable implements MainThreadChat
440440
441441 const chatViewWidget = this . _chatWidgetService . getWidgetBySessionResource ( originalResource ) ;
442442 if ( chatViewWidget && isIChatViewViewContext ( chatViewWidget . viewContext ) ) {
443- await this . _chatSessionsService . getOrCreateChatSession ( modifiedResource , CancellationToken . None ) ;
443+ const newSession = await this . _chatSessionsService . getOrCreateChatSession ( modifiedResource , CancellationToken . None ) ;
444+ // If chat editor is in the side panel, then those are not listed as editors.
445+ // In that case we need to transfer editing session using the original model.
446+ const originalModel = this . _chatService . getSession ( originalResource ) ;
447+ if ( originalModel ) {
448+ newSession . initialEditingSession = originalModel . editingSession ;
449+ }
444450 await this . _chatWidgetService . openSession ( modifiedResource , ChatViewPaneTarget , { preserveFocus : true } ) ;
445451 }
446452 }
You can’t perform that action at this time.
0 commit comments