mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
set notebook inline chat height based on full notebook editor height (#257332)
* notebook inline chat height based on full notebook editor height * just pass optional param
This commit is contained in:
@@ -63,6 +63,7 @@ import { IFileService } from '../../../../platform/files/common/files.js';
|
||||
import { IChatAttachmentResolveService } from '../../chat/browser/chatAttachmentResolveService.js';
|
||||
import { INotebookService } from '../../notebook/common/notebookService.js';
|
||||
import { ICellEditOperation } from '../../notebook/common/notebookCommon.js';
|
||||
import { INotebookEditor } from '../../notebook/browser/notebookBrowser.js';
|
||||
|
||||
export const enum State {
|
||||
CREATE_SESSION = 'CREATE_SESSION',
|
||||
@@ -242,16 +243,18 @@ export class InlineChatController1 implements IEditorContribution {
|
||||
// check if this editor is part of a notebook editor
|
||||
// and iff so, use the notebook location but keep the resolveData
|
||||
// talk about editor data
|
||||
for (const notebookEditor of notebookEditorService.listNotebookEditors()) {
|
||||
for (const [, codeEditor] of notebookEditor.codeEditors) {
|
||||
let notebookEditor: INotebookEditor | undefined;
|
||||
for (const editor of notebookEditorService.listNotebookEditors()) {
|
||||
for (const [, codeEditor] of editor.codeEditors) {
|
||||
if (codeEditor === this._editor) {
|
||||
notebookEditor = editor;
|
||||
location.location = ChatAgentLocation.Notebook;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const zone = _instaService.createInstance(InlineChatZoneWidget, location, undefined, this._editor);
|
||||
const zone = _instaService.createInstance(InlineChatZoneWidget, location, undefined, { editor: this._editor, notebookEditor });
|
||||
this._store.add(zone);
|
||||
this._store.add(zone.widget.chatWidget.onDidClear(async () => {
|
||||
const r = this.joinCurrentRun();
|
||||
@@ -1260,12 +1263,13 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
|
||||
// inline chat in notebooks
|
||||
// check if this editor is part of a notebook editor
|
||||
// and iff so, use the notebook location but keep the resolveData
|
||||
// talk about editor data
|
||||
for (const notebookEditor of this._notebookEditorService.listNotebookEditors()) {
|
||||
for (const [, codeEditor] of notebookEditor.codeEditors) {
|
||||
// if so, update the location and use the notebook specific widget
|
||||
let notebookEditor: INotebookEditor | undefined;
|
||||
for (const editor of this._notebookEditorService.listNotebookEditors()) {
|
||||
for (const [, codeEditor] of editor.codeEditors) {
|
||||
if (codeEditor === this._editor) {
|
||||
location.location = ChatAgentLocation.Notebook;
|
||||
notebookEditor = editor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1279,7 +1283,7 @@ export class InlineChatController2 implements IEditorContribution {
|
||||
renderTextEditsAsSummary: _uri => true
|
||||
}
|
||||
},
|
||||
this._editor
|
||||
{ editor: this._editor, notebookEditor },
|
||||
);
|
||||
|
||||
result.domNode.classList.add('inline-chat-2');
|
||||
|
||||
Reference in New Issue
Block a user