chore - rename interactiveEditor to inlineChat (#184422)

This commit is contained in:
Johannes Rieken
2023-06-06 16:34:55 +02:00
committed by GitHub
parent 3da8c69a18
commit f70686c39e
22 changed files with 42 additions and 45 deletions

View File

@@ -0,0 +1,35 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { illegalState } from 'vs/base/common/errors';
import { Schemas } from 'vs/base/common/network';
import { isEqual } from 'vs/base/common/resources';
import { IInteractiveEditorSessionService } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSession';
import { INotebookEditorService } from 'vs/workbench/contrib/notebook/browser/services/notebookEditorService';
import { CellUri } from 'vs/workbench/contrib/notebook/common/notebookCommon';
export class InteractiveEditorNotebookContribution {
constructor(
@IInteractiveEditorSessionService sessionService: IInteractiveEditorSessionService,
@INotebookEditorService notebookEditorService: INotebookEditorService,
) {
sessionService.registerSessionKeyComputer(Schemas.vscodeNotebookCell, {
getComparisonKey: (_editor, uri) => {
const data = CellUri.parse(uri);
if (!data) {
throw illegalState('Expected notebook');
}
for (const editor of notebookEditorService.listNotebookEditors()) {
if (isEqual(editor.textModel?.uri, data.notebook)) {
return `<notebook>${editor.getId()}#${uri}`;
}
}
throw illegalState('Expected notebook');
}
});
}
}