mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
chore - rename interactiveEditor to inlineChat (#184422)
This commit is contained in:
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user