@codingame/monaco-vscode-notebook-service-override 14.0.6 → 15.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +26 -29
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +29 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +5 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/contribution.js +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookCellDecorators.d.ts +4 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookCellDecorators.js +13 -217
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatActionsOverlay.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatActionsOverlay.js +22 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatEditController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatEditController.js +17 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.js +8 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizer.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizer.js +47 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +28 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +13 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +12 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +14 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +18 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.d.ts +11 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +328 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +8 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +16 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +19 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +39 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +99 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +40 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +31 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +37 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +22 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +11 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +58 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +99 -87
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +12 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +7 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +8 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +20 -16
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +14 -14
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +3 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +2 -2
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DisposableStore } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
2
|
import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
|
|
3
|
-
import {
|
|
4
|
-
import { INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
5
|
-
import { CellDiffInfo } from "@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel";
|
|
3
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
6
4
|
import { ICodeEditor } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
|
|
7
|
-
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker";
|
|
8
|
-
import {
|
|
9
|
-
import { NotebookCellTextModel } from "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
5
|
+
import { IEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service";
|
|
6
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
10
7
|
import { INotebookOriginalCellModelFactory } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.service";
|
|
11
8
|
export declare class NotebookCellDiffDecorator extends DisposableStore {
|
|
12
9
|
readonly modifiedCell: NotebookCellTextModel;
|
|
@@ -25,36 +22,3 @@ export declare class NotebookCellDiffDecorator extends DisposableStore {
|
|
|
25
22
|
private getOrCreateOriginalModel;
|
|
26
23
|
private _updateWithDiff;
|
|
27
24
|
}
|
|
28
|
-
export declare class NotebookInsertedCellDecorator extends Disposable {
|
|
29
|
-
private readonly notebookEditor;
|
|
30
|
-
private readonly decorators;
|
|
31
|
-
constructor(notebookEditor: INotebookEditor);
|
|
32
|
-
apply(diffInfo: CellDiffInfo[]): void;
|
|
33
|
-
clear(): void;
|
|
34
|
-
}
|
|
35
|
-
export interface INotebookDeletedCellDecorator {
|
|
36
|
-
getTop(deletedIndex: number): number | undefined;
|
|
37
|
-
}
|
|
38
|
-
export declare class NotebookDeletedCellDecorator extends Disposable implements INotebookDeletedCellDecorator {
|
|
39
|
-
private readonly _notebookEditor;
|
|
40
|
-
private readonly languageService;
|
|
41
|
-
private readonly zoneRemover;
|
|
42
|
-
private readonly createdViewZones;
|
|
43
|
-
private readonly deletedCellInfos;
|
|
44
|
-
constructor(_notebookEditor: INotebookEditor, languageService: ILanguageService);
|
|
45
|
-
getTop(deletedIndex: number): number | undefined;
|
|
46
|
-
apply(diffInfo: CellDiffInfo[], original: NotebookTextModel): void;
|
|
47
|
-
clear(): void;
|
|
48
|
-
private _createWidget;
|
|
49
|
-
private _createWidgetImpl;
|
|
50
|
-
}
|
|
51
|
-
export declare class NotebookDeletedCellWidget extends Disposable {
|
|
52
|
-
private readonly _notebookEditor;
|
|
53
|
-
private readonly code;
|
|
54
|
-
private readonly language;
|
|
55
|
-
readonly originalIndex: number;
|
|
56
|
-
private readonly languageService;
|
|
57
|
-
private readonly container;
|
|
58
|
-
constructor(_notebookEditor: INotebookEditor, code: string, language: string, container: HTMLElement, originalIndex: number, languageService: ILanguageService);
|
|
59
|
-
render(): Promise<number>;
|
|
60
|
-
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookCellDecorators.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { DisposableStore, toDisposable
|
|
4
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/
|
|
5
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
6
|
-
import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
7
|
-
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
8
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
9
|
-
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
3
|
+
import { DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
10
5
|
import { ChatEditingSessionState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
11
6
|
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
12
7
|
import { ThrottledDelayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
13
|
-
import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker';
|
|
14
|
-
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language';
|
|
8
|
+
import { IEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/editorWorker.service';
|
|
15
9
|
import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
|
|
16
10
|
import { themeColorFromId } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
17
11
|
import { RenderOptions, LineSource, renderLines } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/renderLines';
|
|
@@ -20,14 +14,12 @@ import { TrackedRangeStickiness, MinimapPosition, OverviewRulerLane } from '@cod
|
|
|
20
14
|
import { ModelDecorationOptions } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
21
15
|
import { InlineDecoration, InlineDecorationType } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/viewModel';
|
|
22
16
|
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
23
|
-
import { tokenizeToString } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/textToHtmlTokenizer';
|
|
24
|
-
import { append, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
25
|
-
import { createTrustedTypesPolicy } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/trustedTypes';
|
|
26
|
-
import { splitLines } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
27
|
-
import { DefaultLineHeight } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel';
|
|
28
17
|
import { INotebookOriginalCellModelFactory } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.service';
|
|
29
18
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
30
|
-
import { overviewRulerModifiedForeground, minimapGutterModifiedBackground, overviewRulerAddedForeground, minimapGutterAddedBackground, overviewRulerDeletedForeground, minimapGutterDeletedBackground } from '@codingame/monaco-vscode-
|
|
19
|
+
import { overviewRulerModifiedForeground, minimapGutterModifiedBackground, overviewRulerAddedForeground, minimapGutterAddedBackground, overviewRulerDeletedForeground, minimapGutterDeletedBackground } from '@codingame/monaco-vscode-1bb39316-6fbf-572e-ab6a-818a2496c14f-common/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
20
|
+
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
21
|
+
import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
22
|
+
import { derived } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
31
23
|
|
|
32
24
|
let NotebookCellDiffDecorator = class NotebookCellDiffDecorator extends DisposableStore {
|
|
33
25
|
constructor(notebookEditor, modifiedCell, originalCell, _chatEditingService, _editorWorkerService, originalCellModelFactory) {
|
|
@@ -72,15 +64,13 @@ let NotebookCellDiffDecorator = class NotebookCellDiffDecorator extends Disposab
|
|
|
72
64
|
}
|
|
73
65
|
}));
|
|
74
66
|
const shouldBeReadOnly = derived(this, r => {
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
const value = this._chatEditingService.currentEditingSessionObs.read(r);
|
|
80
|
-
if (!value || value.state.read(r) !== ChatEditingSessionState.StreamingEdits) {
|
|
67
|
+
const editorUri = editorObs.read(r)?.getModel()?.uri;
|
|
68
|
+
if (!editorUri) {
|
|
81
69
|
return false;
|
|
82
70
|
}
|
|
83
|
-
|
|
71
|
+
const sessions = this._chatEditingService.editingSessionsObs.read(r);
|
|
72
|
+
const session = sessions.find(s => ( s.entries.read(r).some(e => isEqual(e.modifiedURI, editorUri))));
|
|
73
|
+
return session?.state.read(r) === ChatEditingSessionState.StreamingEdits;
|
|
84
74
|
});
|
|
85
75
|
let actualReadonly;
|
|
86
76
|
let actualDeco;
|
|
@@ -270,200 +260,6 @@ NotebookCellDiffDecorator = ( __decorate([
|
|
|
270
260
|
( __param(4, IEditorWorkerService)),
|
|
271
261
|
( __param(5, INotebookOriginalCellModelFactory))
|
|
272
262
|
], NotebookCellDiffDecorator));
|
|
273
|
-
class NotebookInsertedCellDecorator extends Disposable {
|
|
274
|
-
constructor(notebookEditor) {
|
|
275
|
-
super();
|
|
276
|
-
this.notebookEditor = notebookEditor;
|
|
277
|
-
this.decorators = this._register(( new DisposableStore()));
|
|
278
|
-
}
|
|
279
|
-
apply(diffInfo) {
|
|
280
|
-
const model = this.notebookEditor.textModel;
|
|
281
|
-
if (!model) {
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
const cells = ( diffInfo.filter(diff => diff.type === 'insert').map((diff) => model.cells[diff.modifiedCellIndex]));
|
|
285
|
-
const ids = this.notebookEditor.deltaCellDecorations([], ( cells.map(cell => ({
|
|
286
|
-
handle: cell.handle,
|
|
287
|
-
options: { className: 'nb-insertHighlight', outputClassName: 'nb-insertHighlight' }
|
|
288
|
-
}))));
|
|
289
|
-
this.clear();
|
|
290
|
-
this.decorators.add(toDisposable(() => {
|
|
291
|
-
if (!this.notebookEditor.isDisposed) {
|
|
292
|
-
this.notebookEditor.deltaCellDecorations(ids, []);
|
|
293
|
-
}
|
|
294
|
-
}));
|
|
295
|
-
}
|
|
296
|
-
clear() {
|
|
297
|
-
this.decorators.clear();
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
const ttPolicy = createTrustedTypesPolicy('notebookChatEditController', { createHTML: value => value });
|
|
301
|
-
let NotebookDeletedCellDecorator = class NotebookDeletedCellDecorator extends Disposable {
|
|
302
|
-
constructor(_notebookEditor, languageService) {
|
|
303
|
-
super();
|
|
304
|
-
this._notebookEditor = _notebookEditor;
|
|
305
|
-
this.languageService = languageService;
|
|
306
|
-
this.zoneRemover = this._register(( new DisposableStore()));
|
|
307
|
-
this.createdViewZones = ( new Map());
|
|
308
|
-
this.deletedCellInfos = ( new Map());
|
|
309
|
-
}
|
|
310
|
-
getTop(deletedIndex) {
|
|
311
|
-
const info = this.deletedCellInfos.get(deletedIndex);
|
|
312
|
-
if (!info) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
const cells = this._notebookEditor.getCellsInRange({ start: info.previousIndex, end: info.previousIndex + 1 });
|
|
316
|
-
if (!cells.length) {
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
const cell = cells[0];
|
|
320
|
-
const cellHeight = this._notebookEditor.getHeightOfElement(cell);
|
|
321
|
-
const top = this._notebookEditor.getAbsoluteTopOfElement(cell);
|
|
322
|
-
return top + cellHeight + info.offset;
|
|
323
|
-
}
|
|
324
|
-
apply(diffInfo, original) {
|
|
325
|
-
this.clear();
|
|
326
|
-
let currentIndex = 0;
|
|
327
|
-
const deletedCellsToRender = { cells: [], index: 0 };
|
|
328
|
-
diffInfo.forEach(diff => {
|
|
329
|
-
if (diff.type === 'delete') {
|
|
330
|
-
const deletedCell = original.cells[diff.originalCellIndex];
|
|
331
|
-
if (deletedCell) {
|
|
332
|
-
deletedCellsToRender.cells.push({ cell: deletedCell, originalIndex: diff.originalCellIndex, previousIndex: currentIndex });
|
|
333
|
-
deletedCellsToRender.index = currentIndex;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
else {
|
|
337
|
-
if (deletedCellsToRender.cells.length) {
|
|
338
|
-
this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
|
|
339
|
-
deletedCellsToRender.cells.length = 0;
|
|
340
|
-
}
|
|
341
|
-
currentIndex = diff.modifiedCellIndex;
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
if (deletedCellsToRender.cells.length) {
|
|
345
|
-
this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
clear() {
|
|
349
|
-
this.deletedCellInfos.clear();
|
|
350
|
-
this.zoneRemover.clear();
|
|
351
|
-
}
|
|
352
|
-
_createWidget(index, cells) {
|
|
353
|
-
this._createWidgetImpl(index, cells);
|
|
354
|
-
}
|
|
355
|
-
async _createWidgetImpl(index, cells) {
|
|
356
|
-
const rootContainer = document.createElement('div');
|
|
357
|
-
const widgets = [];
|
|
358
|
-
const heights = await Promise.all(( cells.map(async (cell) => {
|
|
359
|
-
const widget = ( new NotebookDeletedCellWidget(
|
|
360
|
-
this._notebookEditor,
|
|
361
|
-
cell.cell.getValue(),
|
|
362
|
-
cell.cell.language,
|
|
363
|
-
rootContainer,
|
|
364
|
-
cell.originalIndex,
|
|
365
|
-
this.languageService
|
|
366
|
-
));
|
|
367
|
-
widgets.push(widget);
|
|
368
|
-
const height = await widget.render();
|
|
369
|
-
this.deletedCellInfos.set(cell.originalIndex, { height, previousIndex: cell.previousIndex, offset: 0 });
|
|
370
|
-
return height;
|
|
371
|
-
})));
|
|
372
|
-
Array.from(( this.deletedCellInfos.keys())).sort((a, b) => a - b).forEach((originalIndex) => {
|
|
373
|
-
const previousDeletedCell = this.deletedCellInfos.get(originalIndex - 1);
|
|
374
|
-
if (previousDeletedCell) {
|
|
375
|
-
const deletedCell = this.deletedCellInfos.get(originalIndex);
|
|
376
|
-
if (deletedCell) {
|
|
377
|
-
deletedCell.offset = previousDeletedCell.height + previousDeletedCell.offset;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
const totalHeight = heights.reduce((prev, curr) => prev + curr, 0);
|
|
382
|
-
this._notebookEditor.changeViewZones(accessor => {
|
|
383
|
-
const notebookViewZone = {
|
|
384
|
-
afterModelPosition: index,
|
|
385
|
-
heightInPx: totalHeight + 4,
|
|
386
|
-
domNode: rootContainer
|
|
387
|
-
};
|
|
388
|
-
const id = accessor.addZone(notebookViewZone);
|
|
389
|
-
accessor.layoutZone(id);
|
|
390
|
-
this.createdViewZones.set(index, id);
|
|
391
|
-
this.zoneRemover.add(toDisposable(() => {
|
|
392
|
-
if (this.createdViewZones.get(index) === id) {
|
|
393
|
-
this.createdViewZones.delete(index);
|
|
394
|
-
}
|
|
395
|
-
if (!this._notebookEditor.isDisposed) {
|
|
396
|
-
this._notebookEditor.changeViewZones(accessor => {
|
|
397
|
-
accessor.removeZone(id);
|
|
398
|
-
dispose(widgets);
|
|
399
|
-
});
|
|
400
|
-
}
|
|
401
|
-
}));
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
};
|
|
405
|
-
NotebookDeletedCellDecorator = ( __decorate([
|
|
406
|
-
( __param(1, ILanguageService))
|
|
407
|
-
], NotebookDeletedCellDecorator));
|
|
408
|
-
let NotebookDeletedCellWidget = class NotebookDeletedCellWidget extends Disposable {
|
|
409
|
-
constructor(_notebookEditor,
|
|
410
|
-
code, language, container, originalIndex, languageService) {
|
|
411
|
-
super();
|
|
412
|
-
this._notebookEditor = _notebookEditor;
|
|
413
|
-
this.code = code;
|
|
414
|
-
this.language = language;
|
|
415
|
-
this.originalIndex = originalIndex;
|
|
416
|
-
this.languageService = languageService;
|
|
417
|
-
this.container = append(container, document.createElement('div'));
|
|
418
|
-
this._register(toDisposable(() => {
|
|
419
|
-
container.removeChild(this.container);
|
|
420
|
-
}));
|
|
421
|
-
}
|
|
422
|
-
async render() {
|
|
423
|
-
const code = this.code;
|
|
424
|
-
const languageId = this.language;
|
|
425
|
-
const codeHtml = await tokenizeToString(this.languageService, code, languageId);
|
|
426
|
-
const fontInfo = this._notebookEditor.getBaseCellEditorOptions(languageId).value;
|
|
427
|
-
const fontFamilyVar = '--notebook-editor-font-family';
|
|
428
|
-
const fontSizeVar = '--notebook-editor-font-size';
|
|
429
|
-
const fontWeightVar = '--notebook-editor-font-weight';
|
|
430
|
-
const editor = ( this._notebookEditor.codeEditors.map(c => c[1])).find(c => c);
|
|
431
|
-
const layoutInfo = editor?.getOptions().get(EditorOption.layoutInfo);
|
|
432
|
-
const style = ``
|
|
433
|
-
+ `font-family: var(${fontFamilyVar});`
|
|
434
|
-
+ `font-weight: var(${fontWeightVar});`
|
|
435
|
-
+ `font-size: var(${fontSizeVar});`
|
|
436
|
-
+ fontInfo.lineHeight ? `line-height: ${fontInfo.lineHeight}px;` : ''
|
|
437
|
-
+ layoutInfo?.contentLeft ? `margin-left: ${layoutInfo}px;` : ''
|
|
438
|
-
+ `white-space: pre;`;
|
|
439
|
-
const rootContainer = this.container;
|
|
440
|
-
rootContainer.classList.add('code-cell-row');
|
|
441
|
-
const container = append(rootContainer, $('.cell-inner-container'));
|
|
442
|
-
const focusIndicatorLeft = append(container, $('.cell-focus-indicator.cell-focus-indicator-side.cell-focus-indicator-left'));
|
|
443
|
-
const cellContainer = append(container, $('.cell.code'));
|
|
444
|
-
append(focusIndicatorLeft, $('div.execution-count-label'));
|
|
445
|
-
const editorPart = append(cellContainer, $('.cell-editor-part'));
|
|
446
|
-
let editorContainer = append(editorPart, $('.cell-editor-container'));
|
|
447
|
-
editorContainer = append(editorContainer, $('.code', { style }));
|
|
448
|
-
if (fontInfo.fontFamily) {
|
|
449
|
-
editorContainer.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
|
|
450
|
-
}
|
|
451
|
-
if (fontInfo.fontSize) {
|
|
452
|
-
editorContainer.style.setProperty(fontSizeVar, `${fontInfo.fontSize}px`);
|
|
453
|
-
}
|
|
454
|
-
if (fontInfo.fontWeight) {
|
|
455
|
-
editorContainer.style.setProperty(fontWeightVar, fontInfo.fontWeight);
|
|
456
|
-
}
|
|
457
|
-
editorContainer.innerHTML = (ttPolicy?.createHTML(codeHtml) || codeHtml);
|
|
458
|
-
const lineCount = splitLines(code).length;
|
|
459
|
-
const height = (lineCount * (fontInfo.lineHeight || DefaultLineHeight)) + 12 + 12;
|
|
460
|
-
const totalHeight = height + 16 + 16;
|
|
461
|
-
return totalHeight;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
|
-
NotebookDeletedCellWidget = ( __decorate([
|
|
465
|
-
( __param(5, ILanguageService))
|
|
466
|
-
], NotebookDeletedCellWidget));
|
|
467
263
|
function areDiffsEqual(a, b) {
|
|
468
264
|
if (a && b) {
|
|
469
265
|
if (a.changes.length !== b.changes.length) {
|
|
@@ -533,4 +329,4 @@ function areLineRangeMappinsEqual(a, b) {
|
|
|
533
329
|
return true;
|
|
534
330
|
}
|
|
535
331
|
|
|
536
|
-
export { NotebookCellDiffDecorator
|
|
332
|
+
export { NotebookCellDiffDecorator };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { INotebookEditor } from "@codingame/monaco-vscode-
|
|
2
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
3
3
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
4
|
import { IModifiedFileEntry } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService";
|
|
5
5
|
import { IChatEditingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
|
|
6
6
|
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
7
7
|
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
8
|
-
import { CellDiffInfo } from "@codingame/monaco-vscode-
|
|
9
|
-
import { INotebookDeletedCellDecorator } from "
|
|
8
|
+
import { CellDiffInfo } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel";
|
|
9
|
+
import { INotebookDeletedCellDecorator } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator";
|
|
10
10
|
export declare class NotebookChatActionsOverlayController extends Disposable {
|
|
11
11
|
private readonly notebookEditor;
|
|
12
12
|
private readonly _chatEditingService;
|
|
@@ -14,7 +14,6 @@ export declare class NotebookChatActionsOverlayController extends Disposable {
|
|
|
14
14
|
}
|
|
15
15
|
export declare class NotebookChatActionsOverlay extends Disposable {
|
|
16
16
|
private readonly notebookEditor;
|
|
17
|
-
private readonly _editorService;
|
|
18
17
|
private readonly focusedDiff;
|
|
19
18
|
private readonly toolbarNode;
|
|
20
19
|
private added;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Disposable, toDisposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monaco-vscode-
|
|
4
|
+
import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
5
5
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
6
|
import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
7
7
|
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
@@ -11,16 +11,13 @@ import { $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
|
11
11
|
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
12
12
|
import { ACTIVE_GROUP } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService';
|
|
13
13
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
14
|
-
import
|
|
15
|
-
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
16
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
17
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
18
|
-
import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
19
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
20
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
21
|
-
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
14
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
22
15
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
23
|
-
import { navigationBearingFakeActionId, AcceptAction, RejectAction } from '@codingame/monaco-vscode-
|
|
16
|
+
import { navigationBearingFakeActionId, AcceptAction, RejectAction } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions';
|
|
17
|
+
import { ChatEditingModifiedDocumentEntry } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry';
|
|
18
|
+
import { observableFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
19
|
+
import { autorunWithStore, autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
20
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
24
21
|
|
|
25
22
|
let NotebookChatActionsOverlayController = class NotebookChatActionsOverlayController extends Disposable {
|
|
26
23
|
constructor(notebookEditor, cellDiffInfo, deletedCellDecorator, _chatEditingService, instantiationService) {
|
|
@@ -29,9 +26,14 @@ let NotebookChatActionsOverlayController = class NotebookChatActionsOverlayContr
|
|
|
29
26
|
this._chatEditingService = _chatEditingService;
|
|
30
27
|
const notebookModel = observableFromEvent(this.notebookEditor.onDidChangeModel, e => e);
|
|
31
28
|
this._register(autorunWithStore((r, store) => {
|
|
32
|
-
const session = this._chatEditingService.currentEditingSessionObs.read(r);
|
|
33
29
|
const model = notebookModel.read(r);
|
|
34
|
-
if (!model
|
|
30
|
+
if (!model) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const sessions = this._chatEditingService.editingSessionsObs.read(r);
|
|
34
|
+
const session = sessions.find(s => s.readEntry(model.uri, r));
|
|
35
|
+
const entry = session?.readEntry(model.uri, r);
|
|
36
|
+
if (!session || !entry || !(entry instanceof ChatEditingModifiedDocumentEntry)) {
|
|
35
37
|
return;
|
|
36
38
|
}
|
|
37
39
|
const entries = session.entries.read(r);
|
|
@@ -53,7 +55,6 @@ let NotebookChatActionsOverlay = class NotebookChatActionsOverlay extends Dispos
|
|
|
53
55
|
constructor(notebookEditor, entry, cellDiffInfo, nextEntry, previousEntry, deletedCellDecorator, _editorService, instaService) {
|
|
54
56
|
super();
|
|
55
57
|
this.notebookEditor = notebookEditor;
|
|
56
|
-
this._editorService = _editorService;
|
|
57
58
|
this.focusedDiff = observableValue('focusedDiff', undefined);
|
|
58
59
|
this.added = false;
|
|
59
60
|
this._register(notebookEditor.onDidBlurWidget(() => {
|
|
@@ -88,16 +89,15 @@ let NotebookChatActionsOverlay = class NotebookChatActionsOverlay extends Dispos
|
|
|
88
89
|
},
|
|
89
90
|
menuOptions: { renderShortTitle: true },
|
|
90
91
|
actionViewItemProvider: (action, options) => {
|
|
91
|
-
const that = this;
|
|
92
92
|
if (action.id === navigationBearingFakeActionId) {
|
|
93
|
-
return new (class extends ActionViewItem {
|
|
93
|
+
return this._register(new (class extends ActionViewItem {
|
|
94
94
|
constructor() {
|
|
95
95
|
super(undefined, action, { ...options, icon: false, label: false, keybindingNotRenderedWithLabel: true });
|
|
96
96
|
}
|
|
97
|
-
});
|
|
97
|
+
}));
|
|
98
98
|
}
|
|
99
99
|
if (action.id === AcceptAction.ID || action.id === RejectAction.ID) {
|
|
100
|
-
return new (class extends ActionViewItem {
|
|
100
|
+
return this._register(new (class extends ActionViewItem {
|
|
101
101
|
constructor() {
|
|
102
102
|
super(undefined, action, { ...options, icon: false, label: true, keybindingNotRenderedWithLabel: true });
|
|
103
103
|
this._reveal = this._store.add(( new MutableDisposable()));
|
|
@@ -115,32 +115,23 @@ let NotebookChatActionsOverlay = class NotebookChatActionsOverlay extends Dispos
|
|
|
115
115
|
if (entry === nextEntry) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
const change = nextEntry.diffInfo.get().changes.at(0);
|
|
119
|
-
return that._editorService.openEditor({
|
|
120
|
-
resource: nextEntry.modifiedURI,
|
|
121
|
-
options: {
|
|
122
|
-
selection: change && Range.fromPositions({ lineNumber: change.original.startLineNumber, column: 1 }),
|
|
123
|
-
revealIfOpened: false,
|
|
124
|
-
revealIfVisible: false,
|
|
125
|
-
}
|
|
126
|
-
}, ACTIVE_GROUP);
|
|
127
118
|
}));
|
|
128
119
|
this._reveal.value = store;
|
|
129
120
|
}
|
|
130
121
|
get actionRunner() {
|
|
131
122
|
return super.actionRunner;
|
|
132
123
|
}
|
|
133
|
-
});
|
|
124
|
+
}));
|
|
134
125
|
}
|
|
135
126
|
if (action.id === 'chatEditor.action.navigateNext' || action.id === 'chatEditor.action.navigatePrevious') {
|
|
136
|
-
return new (class extends ActionViewItem {
|
|
127
|
+
return this._register(new (class extends ActionViewItem {
|
|
137
128
|
constructor() {
|
|
138
129
|
super(undefined, action, { ...options, icon: true, label: false, keybindingNotRenderedWithLabel: true });
|
|
139
130
|
}
|
|
140
131
|
set actionRunner(_) {
|
|
141
132
|
const next = action.id === 'chatEditor.action.navigateNext' ? nextEntry : previousEntry;
|
|
142
133
|
const direction = action.id === 'chatEditor.action.navigateNext' ? 'next' : 'previous';
|
|
143
|
-
super.actionRunner = ( new NextPreviousChangeActionRunner(
|
|
134
|
+
super.actionRunner = this._register(( new NextPreviousChangeActionRunner(
|
|
144
135
|
notebookEditor,
|
|
145
136
|
cellDiffInfo,
|
|
146
137
|
entry,
|
|
@@ -149,12 +140,12 @@ let NotebookChatActionsOverlay = class NotebookChatActionsOverlay extends Dispos
|
|
|
149
140
|
_editorService,
|
|
150
141
|
deletedCellDecorator,
|
|
151
142
|
focusedDiff
|
|
152
|
-
));
|
|
143
|
+
)));
|
|
153
144
|
}
|
|
154
145
|
get actionRunner() {
|
|
155
146
|
return super.actionRunner;
|
|
156
147
|
}
|
|
157
|
-
});
|
|
148
|
+
}));
|
|
158
149
|
}
|
|
159
150
|
return undefined;
|
|
160
151
|
}
|
|
@@ -294,12 +285,10 @@ class NextPreviousChangeActionRunner extends ActionRunner {
|
|
|
294
285
|
if (!this.canGoToNextEntry()) {
|
|
295
286
|
return;
|
|
296
287
|
}
|
|
297
|
-
const change = this.next.diffInfo.get().changes.at(0);
|
|
298
288
|
this.focusedDiff.set(undefined, undefined);
|
|
299
289
|
await this.editorService.openEditor({
|
|
300
290
|
resource: this.next.modifiedURI,
|
|
301
291
|
options: {
|
|
302
|
-
selection: change && Range.fromPositions({ lineNumber: change.original.startLineNumber, column: 1 }),
|
|
303
292
|
revealIfOpened: false,
|
|
304
293
|
revealIfVisible: false,
|
|
305
294
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { INotebookEditor, INotebookEditorContribution } from "@codingame/monaco-vscode-
|
|
2
|
+
import { INotebookEditor, INotebookEditorContribution } from "@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
3
3
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
4
4
|
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
5
|
export declare class NotebookChatEditorControllerContrib extends Disposable implements INotebookEditorContribution {
|
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Disposable, dispose, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import
|
|
5
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/arrays';
|
|
6
|
-
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
7
|
-
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
8
|
-
import { derived, derivedWithStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
9
|
-
import '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
10
|
-
import { observableFromEvent, debouncedObservable2 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
4
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
11
5
|
import { WorkingSetEntryState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
12
6
|
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
13
7
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
8
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
15
|
-
import {
|
|
16
|
-
import './notebookSynchronizer.js';
|
|
9
|
+
import { NotebookCellDiffDecorator } from './notebookCellDecorators.js';
|
|
17
10
|
import { INotebookModelSynchronizerFactory } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizer.service';
|
|
18
|
-
import './notebookOriginalModelRefFactory.js';
|
|
19
11
|
import { INotebookOriginalModelReferenceFactory } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.service';
|
|
12
|
+
import { observableFromEvent, debouncedObservable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils';
|
|
20
13
|
import { NotebookChatActionsOverlayController } from './notebookChatActionsOverlay.js';
|
|
21
14
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
22
|
-
import {
|
|
23
|
-
import '@codingame/monaco-vscode-
|
|
24
|
-
import '
|
|
25
|
-
import {
|
|
15
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
16
|
+
import { ctxNotebookHasEditorModification } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookChatEditContext';
|
|
17
|
+
import { NotebookDeletedCellDecorator } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator';
|
|
18
|
+
import { NotebookInsertedCellDecorator } from '@codingame/monaco-vscode-9a6d8b6c-ad4c-5ea3-9558-f43d6dc4c0ad-common/vscode/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator';
|
|
19
|
+
import { ChatEditingModifiedDocumentEntry } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry';
|
|
20
|
+
import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/base';
|
|
21
|
+
import { derived, derivedWithStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/derived';
|
|
22
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/autorun';
|
|
26
23
|
|
|
27
24
|
let NotebookChatEditorControllerContrib = class NotebookChatEditorControllerContrib extends Disposable {
|
|
28
25
|
static { this.ID = 'workbench.notebook.chatEditorController'; }
|
|
@@ -44,13 +41,13 @@ let NotebookChatEditorController = class NotebookChatEditorController extends Di
|
|
|
44
41
|
this.synchronizerFactory = synchronizerFactory;
|
|
45
42
|
this.instantiationService = instantiationService;
|
|
46
43
|
this._ctxHasEditorModification = ctxNotebookHasEditorModification.bindTo(contextKeyService);
|
|
47
|
-
this.deletedCellDecorator = this._register(instantiationService.createInstance(NotebookDeletedCellDecorator, notebookEditor));
|
|
44
|
+
this.deletedCellDecorator = this._register(instantiationService.createInstance(NotebookDeletedCellDecorator, notebookEditor, undefined));
|
|
48
45
|
this.insertedCellDecorator = this._register(instantiationService.createInstance(NotebookInsertedCellDecorator, notebookEditor));
|
|
49
46
|
const notebookModel = observableFromEvent(this.notebookEditor.onDidChangeModel, e => e);
|
|
50
47
|
const originalModel = observableValue('originalModel', undefined);
|
|
51
48
|
const readyToRenderViewzones = observableValue('viewModelAttached', false);
|
|
52
49
|
this._register(Event.once(this.notebookEditor.onDidAttachViewModel)(() => readyToRenderViewzones.set(true, undefined)));
|
|
53
|
-
const onDidChangeVisibleRanges =
|
|
50
|
+
const onDidChangeVisibleRanges = debouncedObservable(observableFromEvent(this.notebookEditor.onDidChangeVisibleRanges, () => this.notebookEditor.visibleRanges), 50);
|
|
54
51
|
const decorators = ( new Map());
|
|
55
52
|
let updatedCellDecoratorsOnceBefore = false;
|
|
56
53
|
let updatedDeletedInsertedDecoratorsOnceBefore = false;
|
|
@@ -63,12 +60,13 @@ let NotebookChatEditorController = class NotebookChatEditorController extends Di
|
|
|
63
60
|
this._register(toDisposable(() => clearDecorators()));
|
|
64
61
|
let notebookSynchronizer;
|
|
65
62
|
const entryObs = derived((r) => {
|
|
66
|
-
const session = this._chatEditingService.currentEditingSessionObs.read(r);
|
|
67
63
|
const model = notebookModel.read(r);
|
|
68
|
-
if (!model
|
|
64
|
+
if (!model) {
|
|
69
65
|
return;
|
|
70
66
|
}
|
|
71
|
-
|
|
67
|
+
const sessions = this._chatEditingService.editingSessionsObs.read(r);
|
|
68
|
+
const entry = ( sessions.map(s => s.readEntry(model.uri, r))).find(r => !!r);
|
|
69
|
+
return entry instanceof ChatEditingModifiedDocumentEntry ? entry : undefined;
|
|
72
70
|
}).recomputeInitiallyAndOnChange(this._store);
|
|
73
71
|
this._register(autorun(r => {
|
|
74
72
|
const entry = entryObs.read(r);
|
|
@@ -177,6 +175,5 @@ NotebookChatEditorController = ( __decorate([
|
|
|
177
175
|
( __param(4, IInstantiationService)),
|
|
178
176
|
( __param(5, IContextKeyService))
|
|
179
177
|
], NotebookChatEditorController));
|
|
180
|
-
registerNotebookContribution(NotebookChatEditorControllerContrib.ID, NotebookChatEditorControllerContrib);
|
|
181
178
|
|
|
182
179
|
export { NotebookChatEditorControllerContrib };
|
|
@@ -3,8 +3,8 @@ import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
3
3
|
import { ITextModel } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
4
4
|
import { CellKind } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
5
5
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
6
|
-
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language";
|
|
7
|
-
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model";
|
|
6
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
7
|
+
import { IModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service";
|
|
8
8
|
import { INotebookOriginalCellModelFactory } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalCellModelFactory.service";
|
|
9
9
|
export declare class OriginalNotebookCellModelReferenceCollection extends ReferenceCollection<ITextModel> {
|
|
10
10
|
private readonly modelService;
|
|
@@ -4,8 +4,8 @@ import { ReferenceCollection } from '@codingame/monaco-vscode-api/vscode/vs/base
|
|
|
4
4
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
5
5
|
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
6
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
|
-
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language';
|
|
8
|
-
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model';
|
|
7
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
8
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
9
9
|
|
|
10
10
|
let OriginalNotebookCellModelReferenceCollection = class OriginalNotebookCellModelReferenceCollection extends ReferenceCollection {
|
|
11
11
|
constructor(modelService, _languageService) {
|
|
@@ -3,11 +3,13 @@ import { IModifiedFileEntry } from "@codingame/monaco-vscode-api/vscode/vs/workb
|
|
|
3
3
|
import { INotebookService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
|
|
4
4
|
import { NotebookTextModel } from "../../../common/model/notebookTextModel.js";
|
|
5
5
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
6
7
|
import { INotebookOriginalModelReferenceFactory } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookOriginalModelRefFactory.service";
|
|
7
8
|
export declare class OriginalNotebookModelReferenceCollection extends ReferenceCollection<Promise<NotebookTextModel>> {
|
|
8
9
|
private readonly notebookService;
|
|
10
|
+
private readonly modelService;
|
|
9
11
|
private readonly modelsToDispose;
|
|
10
|
-
constructor(notebookService: INotebookService);
|
|
12
|
+
constructor(notebookService: INotebookService, modelService: ITextModelService);
|
|
11
13
|
protected createReferencedObject(key: string, fileEntry: IModifiedFileEntry, viewType: string): Promise<NotebookTextModel>;
|
|
12
14
|
protected destroyReferencedObject(key: string, modelPromise: Promise<NotebookTextModel>): void;
|
|
13
15
|
}
|