@codingame/monaco-vscode-notebook-service-override 1.85.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/external/rollup-plugin-styles/dist/runtime/inject-css.js +3 -0
- package/external/tslib/tslib.es6.js +11 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/notebook.d.ts +5 -0
- package/notebook.js +44 -0
- package/override/vs/platform/dialogs/common/dialogs.js +8 -0
- package/package.json +32 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +387 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +668 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +109 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +319 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +485 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +165 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +238 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +168 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +317 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +209 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +87 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +82 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +93 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +383 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +46 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +383 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +117 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +511 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +168 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +94 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +702 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +268 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1297 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +284 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +563 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +108 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +313 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +872 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +393 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +175 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +1121 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +339 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +182 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +106 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +509 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +133 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +342 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +111 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +666 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +200 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +80 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +1001 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +202 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +80 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +217 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +89 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +372 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +706 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +407 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +144 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +129 -0
- package/worker.js +1 -0
- package/workers/notebook.worker.js +9 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
4
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
|
+
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
7
|
+
import { getNotebookEditorFromEditorPane, CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
8
|
+
import { UndoCommand, RedoCommand } from 'monaco-editor/esm/vs/editor/browser/editorExtensions.js';
|
|
9
|
+
|
|
10
|
+
let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Disposable {
|
|
11
|
+
constructor(_editorService) {
|
|
12
|
+
super();
|
|
13
|
+
this._editorService = _editorService;
|
|
14
|
+
const PRIORITY = 105;
|
|
15
|
+
this._register(UndoCommand.addImplementation(PRIORITY, 'notebook-undo-redo', () => {
|
|
16
|
+
const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
17
|
+
const viewModel = editor?.getViewModel();
|
|
18
|
+
if (editor && editor.hasModel() && viewModel) {
|
|
19
|
+
return viewModel.undo().then(cellResources => {
|
|
20
|
+
if (cellResources?.length) {
|
|
21
|
+
for (let i = 0; i < editor.getLength(); i++) {
|
|
22
|
+
const cell = editor.cellAt(i);
|
|
23
|
+
if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
|
|
24
|
+
cell.updateEditState(CellEditState.Editing, 'undo');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
editor?.setOptions({ cellOptions: { resource: cellResources[0] }, preserveFocus: true });
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}));
|
|
33
|
+
this._register(RedoCommand.addImplementation(PRIORITY, 'notebook-undo-redo', () => {
|
|
34
|
+
const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
35
|
+
const viewModel = editor?.getViewModel();
|
|
36
|
+
if (editor && editor.hasModel() && viewModel) {
|
|
37
|
+
return viewModel.redo().then(cellResources => {
|
|
38
|
+
if (cellResources?.length) {
|
|
39
|
+
for (let i = 0; i < editor.getLength(); i++) {
|
|
40
|
+
const cell = editor.cellAt(i);
|
|
41
|
+
if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
|
|
42
|
+
cell.updateEditState(CellEditState.Editing, 'redo');
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
editor?.setOptions({ cellOptions: { resource: cellResources[0] }, preserveFocus: true });
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
NotebookUndoRedoContribution = ( __decorate([
|
|
54
|
+
( __param(0, IEditorService))
|
|
55
|
+
], NotebookUndoRedoContribution));
|
|
56
|
+
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
57
|
+
workbenchContributionsRegistry.registerWorkbenchContribution(NotebookUndoRedoContribution, 2 );
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
3
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { IAccessibilityService } from 'monaco-editor/esm/vs/platform/accessibility/common/accessibility.js';
|
|
5
|
+
import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
6
|
+
import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
7
|
+
import { outputDisplayLimit } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
|
|
8
|
+
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
|
+
import { cellRangesToIndexes } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookRange';
|
|
10
|
+
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
11
|
+
|
|
12
|
+
let NotebookViewportContribution = class NotebookViewportContribution extends Disposable {
|
|
13
|
+
static { this.id = 'workbench.notebook.viewportWarmup'; }
|
|
14
|
+
constructor(_notebookEditor, _notebookService, accessibilityService) {
|
|
15
|
+
super();
|
|
16
|
+
this._notebookEditor = _notebookEditor;
|
|
17
|
+
this._notebookService = _notebookService;
|
|
18
|
+
this._warmupDocument = null;
|
|
19
|
+
this._warmupViewport = ( new RunOnceScheduler(() => this._warmupViewportNow(), 200));
|
|
20
|
+
this._register(this._warmupViewport);
|
|
21
|
+
this._register(this._notebookEditor.onDidScroll(() => {
|
|
22
|
+
this._warmupViewport.schedule();
|
|
23
|
+
}));
|
|
24
|
+
this._warmupDocument = ( new RunOnceScheduler(() => this._warmupDocumentNow(), 200));
|
|
25
|
+
this._register(this._warmupDocument);
|
|
26
|
+
this._register(this._notebookEditor.onDidAttachViewModel(() => {
|
|
27
|
+
if (this._notebookEditor.hasModel()) {
|
|
28
|
+
this._warmupDocument?.schedule();
|
|
29
|
+
}
|
|
30
|
+
}));
|
|
31
|
+
if (this._notebookEditor.hasModel()) {
|
|
32
|
+
this._warmupDocument?.schedule();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
_warmupDocumentNow() {
|
|
36
|
+
if (this._notebookEditor.hasModel()) {
|
|
37
|
+
for (let i = 0; i < this._notebookEditor.getLength(); i++) {
|
|
38
|
+
const cell = this._notebookEditor.cellAt(i);
|
|
39
|
+
if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed) ;
|
|
40
|
+
else if (cell?.cellKind === CellKind.Code) {
|
|
41
|
+
this._warmupCodeCell(cell);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
_warmupViewportNow() {
|
|
47
|
+
if (this._notebookEditor.isDisposed) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!this._notebookEditor.hasModel()) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const visibleRanges = this._notebookEditor.getVisibleRangesPlusViewportAboveAndBelow();
|
|
54
|
+
cellRangesToIndexes(visibleRanges).forEach(index => {
|
|
55
|
+
const cell = this._notebookEditor.cellAt(index);
|
|
56
|
+
if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed) {
|
|
57
|
+
this._notebookEditor.createMarkupPreview(cell);
|
|
58
|
+
}
|
|
59
|
+
else if (cell?.cellKind === CellKind.Code) {
|
|
60
|
+
this._warmupCodeCell(cell);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
_warmupCodeCell(viewCell) {
|
|
65
|
+
if (viewCell.isOutputCollapsed) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const outputs = viewCell.outputsViewModels;
|
|
69
|
+
for (const output of outputs.slice(0, outputDisplayLimit)) {
|
|
70
|
+
const [mimeTypes, pick] = output.resolveMimeTypes(this._notebookEditor.textModel, undefined);
|
|
71
|
+
if (!mimeTypes.find(mimeType => mimeType.isTrusted) || mimeTypes.length === 0) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const pickedMimeTypeRenderer = mimeTypes[pick];
|
|
75
|
+
if (!pickedMimeTypeRenderer) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!this._notebookEditor.hasModel()) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const renderer = this._notebookService.getRendererInfo(pickedMimeTypeRenderer.rendererId);
|
|
82
|
+
if (!renderer) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const result = { type: 1 , renderer, source: output, mimeType: pickedMimeTypeRenderer.mimeType };
|
|
86
|
+
this._notebookEditor.createOutput(viewCell, result, 0, true);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
NotebookViewportContribution = ( __decorate([
|
|
91
|
+
( __param(1, INotebookService)),
|
|
92
|
+
( __param(2, IAccessibilityService))
|
|
93
|
+
], NotebookViewportContribution));
|
|
94
|
+
registerNotebookContribution(NotebookViewportContribution.id, NotebookViewportContribution);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as glob from 'monaco-editor/esm/vs/base/common/glob.js';
|
|
2
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
3
|
+
import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
4
|
+
import { isDocumentExcludePattern } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
5
|
+
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
6
|
+
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
7
|
+
|
|
8
|
+
CommandsRegistry.registerCommand('_resolveNotebookContentProvider', (accessor) => {
|
|
9
|
+
const notebookService = accessor.get(INotebookService);
|
|
10
|
+
const contentProviders = notebookService.getContributedNotebookTypes();
|
|
11
|
+
return ( contentProviders.map(provider => {
|
|
12
|
+
const filenamePatterns = ( provider.selectors.map(selector => {
|
|
13
|
+
if (typeof selector === 'string') {
|
|
14
|
+
return selector;
|
|
15
|
+
}
|
|
16
|
+
if (glob.isRelativePattern(selector)) {
|
|
17
|
+
return selector;
|
|
18
|
+
}
|
|
19
|
+
if (isDocumentExcludePattern(selector)) {
|
|
20
|
+
return {
|
|
21
|
+
include: selector.include,
|
|
22
|
+
exclude: selector.exclude
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
})).filter(pattern => pattern !== null);
|
|
27
|
+
return {
|
|
28
|
+
viewType: provider.id,
|
|
29
|
+
displayName: provider.displayName,
|
|
30
|
+
filenamePattern: filenamePatterns,
|
|
31
|
+
options: {
|
|
32
|
+
transientCellMetadata: provider.options.transientCellMetadata,
|
|
33
|
+
transientDocumentMetadata: provider.options.transientDocumentMetadata,
|
|
34
|
+
transientOutputs: provider.options.transientOutputs
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}));
|
|
38
|
+
});
|
|
39
|
+
CommandsRegistry.registerCommand('_resolveNotebookKernels', async (accessor, args) => {
|
|
40
|
+
const notebookKernelService = accessor.get(INotebookKernelService);
|
|
41
|
+
const uri = URI.revive(args.uri);
|
|
42
|
+
const kernels = notebookKernelService.getMatchingKernel({ uri, viewType: args.viewType });
|
|
43
|
+
return ( kernels.all.map(provider => ({
|
|
44
|
+
id: provider.id,
|
|
45
|
+
label: provider.label,
|
|
46
|
+
description: provider.description,
|
|
47
|
+
detail: provider.detail,
|
|
48
|
+
isPreferred: false,
|
|
49
|
+
preloads: provider.preloadUris,
|
|
50
|
+
})));
|
|
51
|
+
});
|