@codingame/monaco-vscode-notebook-service-override 11.1.2 → 12.0.0
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/index.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +47 -15
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +43 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +109 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +13 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +72 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +23 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +30 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chatEdit/notebookSynchronizerService.js +76 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +61 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +5 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +10 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +52 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +51 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +21 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +4 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +3 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +460 -382
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +124 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +87 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +16 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +9 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.d.ts +53 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +40 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +115 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +111 -117
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +11 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +5 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +7 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +113 -198
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +25 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +115 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +76 -147
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +45 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +30 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +19 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +59 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +11 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +69 -113
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +194 -184
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +51 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +14 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +57 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +29 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +17 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +14 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +21 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +30 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +6 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +134 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +164 -121
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +37 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +6 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +131 -55
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +4 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +12 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +75 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorkerMain.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.d.ts +31 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.d.ts +78 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +45 -42
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.d.ts +96 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +57 -54
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +74 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +6 -3
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.d.ts +53 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +2 -1
- package/worker.js +2 -1
- package/workers/notebook.worker.d.ts +1 -0
- package/notebook.js +0 -50
- package/workers/notebook.worker.js +0 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
1
3
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
2
4
|
import { CodeActionController } from 'vscode/vscode/vs/editor/contrib/codeAction/browser/codeActionController';
|
|
3
5
|
import { CodeActionTriggerSource, CodeActionKind } from 'vscode/vscode/vs/editor/contrib/codeAction/common/types';
|
|
4
6
|
import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
5
7
|
import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
8
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
10
|
+
import { NotebookCellAction, findTargetCellEditor } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
11
|
+
import { CodeCellViewModel } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
|
|
12
|
+
import { NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, NOTEBOOK_CELL_EDITOR_FOCUSED } from '@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
13
|
+
import { InlineChatController } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
14
|
+
import { showChatView } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
15
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
10
16
|
|
|
11
17
|
const OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID = 'notebook.cell.openFailureActions';
|
|
18
|
+
const FIX_CELL_ERROR_COMMAND_ID = 'notebook.cell.chat.fixError';
|
|
19
|
+
const EXPLAIN_CELL_ERROR_COMMAND_ID = 'notebook.cell.chat.explainError';
|
|
12
20
|
registerAction2(class extends NotebookCellAction {
|
|
13
21
|
constructor() {
|
|
14
22
|
super({
|
|
15
23
|
id: OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID,
|
|
16
|
-
title: ( localize2(
|
|
17
|
-
precondition: (
|
|
18
|
-
NOTEBOOK_CELL_FOCUSED,
|
|
19
|
-
NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS,
|
|
20
|
-
(NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated())
|
|
21
|
-
))),
|
|
24
|
+
title: ( localize2(7299, "Show Cell Failure Actions")),
|
|
25
|
+
precondition: ( ContextKeyExpr.and(NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, ( NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated()))),
|
|
22
26
|
f1: true,
|
|
23
27
|
keybinding: {
|
|
24
|
-
when: (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated())
|
|
28
|
-
))),
|
|
29
|
-
primary: 2048 | 89 ,
|
|
30
|
-
weight: 200
|
|
28
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, ( NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated()))),
|
|
29
|
+
primary: KeyMod.CtrlCmd | KeyCode.Period,
|
|
30
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
async runWithContext(accessor, context) {
|
|
35
35
|
if (context.cell instanceof CodeCellViewModel) {
|
|
36
|
-
const error = context.cell.
|
|
36
|
+
const error = context.cell.executionErrorDiagnostic.get();
|
|
37
37
|
if (error?.location) {
|
|
38
38
|
const location = Range.lift({
|
|
39
39
|
startLineNumber: error.location.startLineNumber + 1,
|
|
@@ -45,11 +45,64 @@ registerAction2(class extends NotebookCellAction {
|
|
|
45
45
|
const editor = findTargetCellEditor(context, context.cell);
|
|
46
46
|
if (editor) {
|
|
47
47
|
const controller = CodeActionController.get(editor);
|
|
48
|
-
controller?.manualTriggerAtCurrentPosition(( localize(
|
|
48
|
+
controller?.manualTriggerAtCurrentPosition(( localize(7300, "No code actions available")), CodeActionTriggerSource.Default, { include: CodeActionKind.QuickFix });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
registerAction2(class extends NotebookCellAction {
|
|
55
|
+
constructor() {
|
|
56
|
+
super({
|
|
57
|
+
id: FIX_CELL_ERROR_COMMAND_ID,
|
|
58
|
+
title: ( localize2(7301, "Fix Cell Error")),
|
|
59
|
+
precondition: ( ContextKeyExpr.and(NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, ( NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated()))),
|
|
60
|
+
f1: true
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async runWithContext(accessor, context) {
|
|
64
|
+
if (context.cell instanceof CodeCellViewModel) {
|
|
65
|
+
const error = context.cell.executionErrorDiagnostic.get();
|
|
66
|
+
if (error?.location) {
|
|
67
|
+
const location = Range.lift({
|
|
68
|
+
startLineNumber: error.location.startLineNumber + 1,
|
|
69
|
+
startColumn: error.location.startColumn + 1,
|
|
70
|
+
endLineNumber: error.location.endLineNumber + 1,
|
|
71
|
+
endColumn: error.location.endColumn + 1
|
|
72
|
+
});
|
|
73
|
+
context.notebookEditor.setCellEditorSelection(context.cell, Range.lift(location));
|
|
74
|
+
const editor = findTargetCellEditor(context, context.cell);
|
|
75
|
+
if (editor) {
|
|
76
|
+
const controller = InlineChatController.get(editor);
|
|
77
|
+
const message = error.name ? `${error.name}: ${error.message}` : error.message;
|
|
78
|
+
if (controller) {
|
|
79
|
+
await controller.run({ message: '/fix ' + message, initialRange: location, autoSend: true });
|
|
80
|
+
}
|
|
49
81
|
}
|
|
50
82
|
}
|
|
51
83
|
}
|
|
52
84
|
}
|
|
53
85
|
});
|
|
86
|
+
registerAction2(class extends NotebookCellAction {
|
|
87
|
+
constructor() {
|
|
88
|
+
super({
|
|
89
|
+
id: EXPLAIN_CELL_ERROR_COMMAND_ID,
|
|
90
|
+
title: ( localize2(7302, "Explain Cell Error")),
|
|
91
|
+
precondition: ( ContextKeyExpr.and(NOTEBOOK_CELL_FOCUSED, NOTEBOOK_CELL_HAS_ERROR_DIAGNOSTICS, ( NOTEBOOK_CELL_EDITOR_FOCUSED.toNegated()))),
|
|
92
|
+
f1: true
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
async runWithContext(accessor, context) {
|
|
96
|
+
if (context.cell instanceof CodeCellViewModel) {
|
|
97
|
+
const error = context.cell.executionErrorDiagnostic.get();
|
|
98
|
+
if (error?.message) {
|
|
99
|
+
const viewsService = accessor.get(IViewsService);
|
|
100
|
+
const chatWidget = await showChatView(viewsService);
|
|
101
|
+
const message = error.name ? `${error.name}: ${error.message}` : error.message;
|
|
102
|
+
chatWidget?.acceptInput('@workspace /explain ' + message);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
});
|
|
54
107
|
|
|
55
|
-
export { OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID };
|
|
108
|
+
export { EXPLAIN_CELL_ERROR_COMMAND_ID, FIX_CELL_ERROR_COMMAND_ID, OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
+
import { INotebookEditor, INotebookEditorContribution } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
4
|
+
export declare class DiagnosticCellStatusBarContrib extends Disposable implements INotebookEditorContribution {
|
|
5
|
+
static id: string;
|
|
6
|
+
constructor(notebookEditor: INotebookEditor, instantiationService: IInstantiationService);
|
|
7
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import 'vscode/vscode/vs/base/common/arrays';
|
|
4
5
|
import 'vscode/vscode/vs/base/common/event';
|
|
@@ -10,41 +11,45 @@ import { localize } from 'vscode/vscode/vs/nls';
|
|
|
10
11
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
12
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
12
13
|
import { OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID } from './cellDiagnosticsActions.js';
|
|
13
|
-
import { NotebookStatusBarController } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController';
|
|
14
|
-
import { registerNotebookContribution } from '@codingame/monaco-vscode-
|
|
15
|
-
import { CodeCellViewModel } from '@codingame/monaco-vscode-
|
|
14
|
+
import { NotebookStatusBarController } from '@codingame/monaco-vscode-1ae7d696-d960-5ac6-97a3-9fe7c8c3a793-common/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController';
|
|
15
|
+
import { registerNotebookContribution } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
16
|
+
import { CodeCellViewModel } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
|
|
17
|
+
import { CellStatusbarAlignment } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
18
|
+
import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
19
|
+
import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
|
|
16
20
|
|
|
17
21
|
let DiagnosticCellStatusBarContrib = class DiagnosticCellStatusBarContrib extends Disposable {
|
|
18
22
|
static { this.id = 'workbench.notebook.statusBar.diagtnostic'; }
|
|
19
23
|
constructor(notebookEditor, instantiationService) {
|
|
20
24
|
super();
|
|
21
|
-
this._register((
|
|
25
|
+
this._register(( new NotebookStatusBarController(notebookEditor, (vm, cell) => cell instanceof CodeCellViewModel ?
|
|
22
26
|
instantiationService.createInstance(DiagnosticCellStatusBarItem, vm, cell) :
|
|
23
|
-
Disposable.None)))
|
|
27
|
+
Disposable.None)));
|
|
24
28
|
}
|
|
25
29
|
};
|
|
26
|
-
DiagnosticCellStatusBarContrib = (
|
|
27
|
-
(
|
|
28
|
-
], DiagnosticCellStatusBarContrib))
|
|
30
|
+
DiagnosticCellStatusBarContrib = ( __decorate([
|
|
31
|
+
( __param(1, IInstantiationService))
|
|
32
|
+
], DiagnosticCellStatusBarContrib));
|
|
29
33
|
registerNotebookContribution(DiagnosticCellStatusBarContrib.id, DiagnosticCellStatusBarContrib);
|
|
30
34
|
let DiagnosticCellStatusBarItem = class DiagnosticCellStatusBarItem extends Disposable {
|
|
31
|
-
constructor(_notebookViewModel, cell, keybindingService) {
|
|
35
|
+
constructor(_notebookViewModel, cell, keybindingService, chatAgentService) {
|
|
32
36
|
super();
|
|
33
37
|
this._notebookViewModel = _notebookViewModel;
|
|
34
38
|
this.cell = cell;
|
|
35
39
|
this.keybindingService = keybindingService;
|
|
40
|
+
this.chatAgentService = chatAgentService;
|
|
36
41
|
this._currentItemIds = [];
|
|
37
|
-
this._register(autorun((reader) => this.updateSparkleItem(reader.readObservable(cell.
|
|
42
|
+
this._register(autorun((reader) => this.updateSparkleItem(reader.readObservable(cell.executionErrorDiagnostic))));
|
|
38
43
|
}
|
|
39
44
|
async updateSparkleItem(error) {
|
|
40
45
|
let item;
|
|
41
|
-
if (error?.location) {
|
|
46
|
+
if (error?.location && !Iterable.isEmpty(this.chatAgentService.getAgents())) {
|
|
42
47
|
const keybinding = this.keybindingService.lookupKeybinding(OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID)?.getLabel();
|
|
43
|
-
const tooltip = ( localize(
|
|
48
|
+
const tooltip = ( localize(7303, "Quick Actions {0}", `(${keybinding})`));
|
|
44
49
|
item = {
|
|
45
50
|
text: `$(sparkle)`,
|
|
46
51
|
tooltip,
|
|
47
|
-
alignment:
|
|
52
|
+
alignment: CellStatusbarAlignment.Left,
|
|
48
53
|
command: OPEN_CELL_FAILURE_ACTIONS_COMMAND_ID,
|
|
49
54
|
priority: Number.MAX_SAFE_INTEGER - 1
|
|
50
55
|
};
|
|
@@ -57,8 +62,9 @@ let DiagnosticCellStatusBarItem = class DiagnosticCellStatusBarItem extends Disp
|
|
|
57
62
|
this._notebookViewModel.deltaCellStatusBarItems(this._currentItemIds, [{ handle: this.cell.handle, items: [] }]);
|
|
58
63
|
}
|
|
59
64
|
};
|
|
60
|
-
DiagnosticCellStatusBarItem = (
|
|
61
|
-
(
|
|
62
|
-
|
|
65
|
+
DiagnosticCellStatusBarItem = ( __decorate([
|
|
66
|
+
( __param(2, IKeybindingService)),
|
|
67
|
+
( __param(3, IChatAgentService))
|
|
68
|
+
], DiagnosticCellStatusBarItem));
|
|
63
69
|
|
|
64
70
|
export { DiagnosticCellStatusBarContrib };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { INotebookEditor, INotebookEditorContribution } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
3
|
+
import { INotebookCellStatusBarService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service";
|
|
4
|
+
export declare class ContributedStatusBarItemController extends Disposable implements INotebookEditorContribution {
|
|
5
|
+
private readonly _notebookEditor;
|
|
6
|
+
private readonly _notebookCellStatusBarService;
|
|
7
|
+
static id: string;
|
|
8
|
+
private readonly _visibleCells;
|
|
9
|
+
private readonly _observer;
|
|
10
|
+
constructor(_notebookEditor: INotebookEditor, _notebookCellStatusBarService: INotebookCellStatusBarService);
|
|
11
|
+
private _updateEverything;
|
|
12
|
+
private _updateVisibleCells;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Throttler } from 'vscode/vscode/vs/base/common/async';
|
|
3
4
|
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
4
5
|
import { Disposable, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { NotebookVisibleCellObserver } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver';
|
|
6
|
-
import { registerNotebookContribution } from '@codingame/monaco-vscode-
|
|
6
|
+
import { NotebookVisibleCellObserver } from '@codingame/monaco-vscode-1ae7d696-d960-5ac6-97a3-9fe7c8c3a793-common/vscode/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver';
|
|
7
|
+
import { registerNotebookContribution } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
7
8
|
import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service';
|
|
8
9
|
|
|
9
10
|
let ContributedStatusBarItemController = class ContributedStatusBarItemController extends Disposable {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
2
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
4
5
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
@@ -8,12 +9,13 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/c
|
|
|
8
9
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
9
10
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
10
11
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
11
|
-
import { CHANGE_CELL_LANGUAGE, DETECT_CELL_LANGUAGE } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
12
|
+
import { CHANGE_CELL_LANGUAGE, DETECT_CELL_LANGUAGE } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
12
13
|
import { INotebookCellStatusBarService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCellStatusBarService.service';
|
|
13
|
-
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
14
|
+
import { CellKind, CellStatusbarAlignment } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
14
15
|
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
15
16
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
16
17
|
import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service';
|
|
18
|
+
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
17
19
|
|
|
18
20
|
let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvider {
|
|
19
21
|
constructor(_notebookService, _languageService) {
|
|
@@ -39,7 +41,7 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
|
|
|
39
41
|
}
|
|
40
42
|
else {
|
|
41
43
|
const searchTooltip = ( localize(
|
|
42
|
-
|
|
44
|
+
7311,
|
|
43
45
|
"Unknown cell language. Click to search for '{0}' extensions",
|
|
44
46
|
cell.language
|
|
45
47
|
));
|
|
@@ -47,7 +49,7 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
|
|
|
47
49
|
text: `$(dialog-warning)`,
|
|
48
50
|
command: { id: 'workbench.extensions.search', arguments: [`@tag:${cell.language}`], title: 'Search Extensions' },
|
|
49
51
|
tooltip: searchTooltip,
|
|
50
|
-
alignment:
|
|
52
|
+
alignment: CellStatusbarAlignment.Right,
|
|
51
53
|
priority: -Number.MAX_SAFE_INTEGER + 1
|
|
52
54
|
});
|
|
53
55
|
}
|
|
@@ -55,8 +57,8 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
|
|
|
55
57
|
statusBarItems.push({
|
|
56
58
|
text: displayLanguage,
|
|
57
59
|
command: CHANGE_CELL_LANGUAGE,
|
|
58
|
-
tooltip: ( localize(
|
|
59
|
-
alignment:
|
|
60
|
+
tooltip: ( localize(7312, "Select Cell Language Mode")),
|
|
61
|
+
alignment: CellStatusbarAlignment.Right,
|
|
60
62
|
priority: -Number.MAX_SAFE_INTEGER
|
|
61
63
|
});
|
|
62
64
|
return {
|
|
@@ -64,10 +66,10 @@ let CellStatusBarLanguagePickerProvider = class CellStatusBarLanguagePickerProvi
|
|
|
64
66
|
};
|
|
65
67
|
}
|
|
66
68
|
};
|
|
67
|
-
CellStatusBarLanguagePickerProvider = (
|
|
68
|
-
(
|
|
69
|
-
(
|
|
70
|
-
], CellStatusBarLanguagePickerProvider))
|
|
69
|
+
CellStatusBarLanguagePickerProvider = ( __decorate([
|
|
70
|
+
( __param(0, INotebookService)),
|
|
71
|
+
( __param(1, ILanguageService))
|
|
72
|
+
], CellStatusBarLanguagePickerProvider));
|
|
71
73
|
let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectionProvider {
|
|
72
74
|
constructor(_notebookService, _notebookKernelService, _languageService, _configurationService, _languageDetectionService, _keybindingService) {
|
|
73
75
|
this._notebookService = _notebookService;
|
|
@@ -77,7 +79,7 @@ let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectio
|
|
|
77
79
|
this._languageDetectionService = _languageDetectionService;
|
|
78
80
|
this._keybindingService = _keybindingService;
|
|
79
81
|
this.viewType = '*';
|
|
80
|
-
this.cache = (
|
|
82
|
+
this.cache = ( new ResourceMap());
|
|
81
83
|
}
|
|
82
84
|
async provideCellStatusBarItems(uri, index, token) {
|
|
83
85
|
const doc = this._notebookService.getNotebookTextModel(uri);
|
|
@@ -98,7 +100,7 @@ let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectio
|
|
|
98
100
|
const currentLanguageId = cell.cellKind === CellKind.Markup ?
|
|
99
101
|
'markdown' :
|
|
100
102
|
(this._languageService.getLanguageIdByLanguageName(cell.language) || cell.language);
|
|
101
|
-
if (!(
|
|
103
|
+
if (!( this.cache.has(cellUri))) {
|
|
102
104
|
this.cache.set(cellUri, {
|
|
103
105
|
cellLanguage: currentLanguageId,
|
|
104
106
|
updateTimestamp: 0,
|
|
@@ -119,7 +121,7 @@ let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectio
|
|
|
119
121
|
const items = [];
|
|
120
122
|
if (cached.guess && currentLanguageId !== cached.guess) {
|
|
121
123
|
const detectedName = this._languageService.getLanguageName(cached.guess) || cached.guess;
|
|
122
|
-
let tooltip = ( localize(
|
|
124
|
+
let tooltip = ( localize(7313, "Accept Detected Language: {0}", detectedName));
|
|
123
125
|
const keybinding = this._keybindingService.lookupKeybinding(DETECT_CELL_LANGUAGE);
|
|
124
126
|
const label = keybinding?.getLabel();
|
|
125
127
|
if (label) {
|
|
@@ -129,21 +131,21 @@ let CellStatusBarLanguageDetectionProvider = class CellStatusBarLanguageDetectio
|
|
|
129
131
|
text: '$(lightbulb-autofix)',
|
|
130
132
|
command: DETECT_CELL_LANGUAGE,
|
|
131
133
|
tooltip,
|
|
132
|
-
alignment:
|
|
134
|
+
alignment: CellStatusbarAlignment.Right,
|
|
133
135
|
priority: -Number.MAX_SAFE_INTEGER + 1
|
|
134
136
|
});
|
|
135
137
|
}
|
|
136
138
|
return { items };
|
|
137
139
|
}
|
|
138
140
|
};
|
|
139
|
-
CellStatusBarLanguageDetectionProvider = (
|
|
140
|
-
(
|
|
141
|
-
(
|
|
142
|
-
(
|
|
143
|
-
(
|
|
144
|
-
(
|
|
145
|
-
(
|
|
146
|
-
], CellStatusBarLanguageDetectionProvider))
|
|
141
|
+
CellStatusBarLanguageDetectionProvider = ( __decorate([
|
|
142
|
+
( __param(0, INotebookService)),
|
|
143
|
+
( __param(1, INotebookKernelService)),
|
|
144
|
+
( __param(2, ILanguageService)),
|
|
145
|
+
( __param(3, IConfigurationService)),
|
|
146
|
+
( __param(4, ILanguageDetectionService)),
|
|
147
|
+
( __param(5, IKeybindingService))
|
|
148
|
+
], CellStatusBarLanguageDetectionProvider));
|
|
147
149
|
let BuiltinCellStatusBarProviders = class BuiltinCellStatusBarProviders extends Disposable {
|
|
148
150
|
constructor(instantiationService, notebookCellStatusBarService) {
|
|
149
151
|
super();
|
|
@@ -156,8 +158,8 @@ let BuiltinCellStatusBarProviders = class BuiltinCellStatusBarProviders extends
|
|
|
156
158
|
});
|
|
157
159
|
}
|
|
158
160
|
};
|
|
159
|
-
BuiltinCellStatusBarProviders = (
|
|
160
|
-
(
|
|
161
|
-
(
|
|
162
|
-
], BuiltinCellStatusBarProviders))
|
|
163
|
-
(
|
|
161
|
+
BuiltinCellStatusBarProviders = ( __decorate([
|
|
162
|
+
( __param(0, IInstantiationService)),
|
|
163
|
+
( __param(1, INotebookCellStatusBarService))
|
|
164
|
+
], BuiltinCellStatusBarProviders));
|
|
165
|
+
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(BuiltinCellStatusBarProviders, LifecyclePhase.Restored);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IFileService } from "vscode/vscode/vs/platform/files/common/files.service";
|
|
2
|
+
import { IStoredFileWorkingCopy } from "@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy";
|
|
3
|
+
import { IUntitledFileWorkingCopy } from "../../../../../services/workingCopy/common/untitledFileWorkingCopy.js";
|
|
4
|
+
import { IWorkingCopyFileService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service";
|
|
5
|
+
import { IChatEditingService } from "vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service";
|
|
6
|
+
import { NotebookFileWorkingCopyModel } from "@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/contrib/notebook/common/notebookEditorModel";
|
|
7
|
+
import { INotebookSynchronizerService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookSynchronizerService.service";
|
|
8
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
9
|
+
import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
10
|
+
export declare class NotebookSynchronizerService extends Disposable implements INotebookSynchronizerService {
|
|
11
|
+
private readonly _chatEditingService;
|
|
12
|
+
protected readonly _fileService: IFileService;
|
|
13
|
+
private readonly _instantiationService;
|
|
14
|
+
private readonly _workingCopyFileService;
|
|
15
|
+
_serviceBrand: undefined;
|
|
16
|
+
constructor(_chatEditingService: IChatEditingService, _fileService: IFileService, _instantiationService: IInstantiationService, _workingCopyFileService: IWorkingCopyFileService);
|
|
17
|
+
revert(workingCopy: IStoredFileWorkingCopy<NotebookFileWorkingCopyModel> | IUntitledFileWorkingCopy<NotebookFileWorkingCopyModel>): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
|
|
3
|
+
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
|
|
4
|
+
import { StoredFileWorkingCopy } from '@codingame/monaco-vscode-99f24462-c56d-5407-83fb-2ea9dd33cc8c-common/vscode/vs/workbench/services/workingCopy/common/storedFileWorkingCopy';
|
|
5
|
+
import { IWorkingCopyFileService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyFileService.service';
|
|
6
|
+
import { ChatEditingModifiedNotebookEntry } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry';
|
|
7
|
+
import { IChatEditingService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
8
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
10
|
+
import { NotebookSaveParticipant } from '../saveParticipants/saveParticipants.js';
|
|
11
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
|
+
|
|
13
|
+
let NotebookSynchronizerSaveParticipant = class NotebookSynchronizerSaveParticipant extends NotebookSaveParticipant {
|
|
14
|
+
constructor(editorService, _chatEditingService, _fileService) {
|
|
15
|
+
super(editorService);
|
|
16
|
+
this._chatEditingService = _chatEditingService;
|
|
17
|
+
this._fileService = _fileService;
|
|
18
|
+
}
|
|
19
|
+
async participate(workingCopy, context, progress, token) {
|
|
20
|
+
console.log('notebook synchronizer participate');
|
|
21
|
+
const session = this._chatEditingService.currentEditingSessionObs.get();
|
|
22
|
+
if (!session) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const entry = session.getEntry(workingCopy.resource);
|
|
26
|
+
if (entry && entry instanceof ChatEditingModifiedNotebookEntry) {
|
|
27
|
+
await entry.saveMirrorDocument();
|
|
28
|
+
}
|
|
29
|
+
const inWorkingSet = ( session.workingSet.has(workingCopy.resource));
|
|
30
|
+
if (!(entry && entry instanceof ChatEditingModifiedNotebookEntry) && !inWorkingSet) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (workingCopy instanceof StoredFileWorkingCopy) {
|
|
34
|
+
const metadata = await this._fileService.stat(workingCopy.resource);
|
|
35
|
+
if (workingCopy.lastResolvedFileStat) {
|
|
36
|
+
workingCopy.lastResolvedFileStat = {
|
|
37
|
+
...workingCopy.lastResolvedFileStat,
|
|
38
|
+
...metadata
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
NotebookSynchronizerSaveParticipant = ( __decorate([
|
|
45
|
+
( __param(0, IEditorService)),
|
|
46
|
+
( __param(1, IChatEditingService)),
|
|
47
|
+
( __param(2, IFileService))
|
|
48
|
+
], NotebookSynchronizerSaveParticipant));
|
|
49
|
+
let NotebookSynchronizerService = class NotebookSynchronizerService extends Disposable {
|
|
50
|
+
constructor(_chatEditingService, _fileService, _instantiationService, _workingCopyFileService) {
|
|
51
|
+
super();
|
|
52
|
+
this._chatEditingService = _chatEditingService;
|
|
53
|
+
this._fileService = _fileService;
|
|
54
|
+
this._instantiationService = _instantiationService;
|
|
55
|
+
this._workingCopyFileService = _workingCopyFileService;
|
|
56
|
+
this._register(this._workingCopyFileService.addSaveParticipant(this._instantiationService.createInstance(NotebookSynchronizerSaveParticipant)));
|
|
57
|
+
}
|
|
58
|
+
async revert(workingCopy) {
|
|
59
|
+
const resource = workingCopy.resource;
|
|
60
|
+
const session = this._chatEditingService.currentEditingSessionObs.get();
|
|
61
|
+
if (session) {
|
|
62
|
+
const entry = session.getEntry(resource);
|
|
63
|
+
if (entry instanceof ChatEditingModifiedNotebookEntry) {
|
|
64
|
+
await entry.revertMirrorDocument();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
NotebookSynchronizerService = ( __decorate([
|
|
70
|
+
( __param(0, IChatEditingService)),
|
|
71
|
+
( __param(1, IFileService)),
|
|
72
|
+
( __param(2, IInstantiationService)),
|
|
73
|
+
( __param(3, IWorkingCopyFileService))
|
|
74
|
+
], NotebookSynchronizerService));
|
|
75
|
+
|
|
76
|
+
export { NotebookSynchronizerService };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
3
|
+
import { ICellViewModel, INotebookEditor } from "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
4
|
+
import { NotebookCellTextModel } from "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel";
|
|
5
|
+
import { ServicesAccessor } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
export declare function runPasteCells(editor: INotebookEditor, activeCell: ICellViewModel | undefined, pasteCells: {
|
|
7
|
+
items: NotebookCellTextModel[];
|
|
8
|
+
isCopy: boolean;
|
|
9
|
+
}): boolean;
|
|
10
|
+
export declare function runCopyCells(accessor: ServicesAccessor, editor: INotebookEditor, targetCell: ICellViewModel | undefined): boolean;
|
|
11
|
+
export declare function runCutCells(accessor: ServicesAccessor, editor: INotebookEditor, targetCell: ICellViewModel | undefined): boolean;
|
|
12
|
+
export declare class NotebookClipboardContribution extends Disposable {
|
|
13
|
+
private readonly _editorService;
|
|
14
|
+
static readonly ID = "workbench.contrib.notebookClipboard";
|
|
15
|
+
constructor(_editorService: IEditorService);
|
|
16
|
+
private _getContext;
|
|
17
|
+
private _focusInsideEmebedMonaco;
|
|
18
|
+
runCopyAction(accessor: ServicesAccessor): boolean;
|
|
19
|
+
runPasteAction(accessor: ServicesAccessor): boolean;
|
|
20
|
+
runCutAction(accessor: ServicesAccessor): boolean;
|
|
21
|
+
}
|