@codingame/monaco-vscode-notebook-service-override 4.1.0 → 4.1.2
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/notebook.js +12 -12
- package/override/vs/platform/dialogs/common/dialogs.js +10 -0
- package/package.json +2 -2
- 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 +391 -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/statusBarProviders.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +544 -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 +320 -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/format/formatting.js +209 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +84 -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 +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +393 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +5 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +60 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +150 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +656 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +77 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +517 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +56 -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/chat/cellChatActions.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +721 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +351 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +315 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +199 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +47 -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 +115 -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 +911 -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 +395 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +185 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +1187 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +159 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +451 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +192 -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 +510 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +130 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +341 -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 +641 -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 +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +1002 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +203 -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/services/workingCopy/common/abstractFileWorkingCopyManager.js +89 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +386 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +408 -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
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { CancellationTokenSource } from 'vscode/vscode/vs/base/common/cancellation';
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { variablePageSize } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
4
|
+
|
|
5
|
+
class NotebookVariableDataSource {
|
|
6
|
+
constructor(notebookKernelService) {
|
|
7
|
+
this.notebookKernelService = notebookKernelService;
|
|
8
|
+
this.cancellationTokenSource = ( new CancellationTokenSource());
|
|
9
|
+
}
|
|
10
|
+
hasChildren(element) {
|
|
11
|
+
return element.kind === 'root' || element.hasNamedChildren || element.indexedChildrenCount > 0;
|
|
12
|
+
}
|
|
13
|
+
cancel() {
|
|
14
|
+
this.cancellationTokenSource.cancel();
|
|
15
|
+
this.cancellationTokenSource.dispose();
|
|
16
|
+
this.cancellationTokenSource = ( new CancellationTokenSource());
|
|
17
|
+
}
|
|
18
|
+
async getChildren(element) {
|
|
19
|
+
if (element.kind === 'root') {
|
|
20
|
+
return this.getRootVariables(element.notebook);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return this.getVariables(element);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async getVariables(parent) {
|
|
27
|
+
const selectedKernel = this.notebookKernelService.getMatchingKernel(parent.notebook).selected;
|
|
28
|
+
if (selectedKernel && selectedKernel.hasVariableProvider) {
|
|
29
|
+
let children = [];
|
|
30
|
+
if (parent.hasNamedChildren) {
|
|
31
|
+
const variables = selectedKernel.provideVariables(parent.notebook.uri, parent.extHostId, 'named', 0, this.cancellationTokenSource.token);
|
|
32
|
+
const childNodes = await ( variables
|
|
33
|
+
.map(
|
|
34
|
+
variable => { return this.createVariableElement(variable, parent.notebook); }
|
|
35
|
+
))
|
|
36
|
+
.toPromise();
|
|
37
|
+
children = children.concat(childNodes);
|
|
38
|
+
}
|
|
39
|
+
if (parent.indexedChildrenCount > 0) {
|
|
40
|
+
const childNodes = await this.getIndexedChildren(parent, selectedKernel);
|
|
41
|
+
children = children.concat(childNodes);
|
|
42
|
+
}
|
|
43
|
+
return children;
|
|
44
|
+
}
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
async getIndexedChildren(parent, kernel) {
|
|
48
|
+
const childNodes = [];
|
|
49
|
+
if (parent.indexedChildrenCount > variablePageSize) {
|
|
50
|
+
const nestedPageSize = Math.floor(Math.max(parent.indexedChildrenCount / variablePageSize, 100));
|
|
51
|
+
const indexedChildCountLimit = 1_000_000;
|
|
52
|
+
let start = parent.indexStart ?? 0;
|
|
53
|
+
const last = start + Math.min(parent.indexedChildrenCount, indexedChildCountLimit);
|
|
54
|
+
for (; start < last; start += nestedPageSize) {
|
|
55
|
+
let end = start + nestedPageSize;
|
|
56
|
+
if (end > last) {
|
|
57
|
+
end = last;
|
|
58
|
+
}
|
|
59
|
+
childNodes.push({
|
|
60
|
+
kind: 'variable',
|
|
61
|
+
notebook: parent.notebook,
|
|
62
|
+
id: parent.id + `${start}`,
|
|
63
|
+
extHostId: parent.extHostId,
|
|
64
|
+
name: `[${start}..${end - 1}]`,
|
|
65
|
+
value: '',
|
|
66
|
+
indexedChildrenCount: end - start,
|
|
67
|
+
indexStart: start,
|
|
68
|
+
hasNamedChildren: false
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
if (parent.indexedChildrenCount > indexedChildCountLimit) {
|
|
72
|
+
childNodes.push({
|
|
73
|
+
kind: 'variable',
|
|
74
|
+
notebook: parent.notebook,
|
|
75
|
+
id: parent.id + `${last + 1}`,
|
|
76
|
+
extHostId: parent.extHostId,
|
|
77
|
+
name: ( localizeWithPath(
|
|
78
|
+
'vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource',
|
|
79
|
+
'notebook.indexedChildrenLimitReached',
|
|
80
|
+
"Display limit reached"
|
|
81
|
+
)),
|
|
82
|
+
value: '',
|
|
83
|
+
indexedChildrenCount: 0,
|
|
84
|
+
hasNamedChildren: false
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
else if (parent.indexedChildrenCount > 0) {
|
|
89
|
+
const variables = kernel.provideVariables(parent.notebook.uri, parent.extHostId, 'indexed', parent.indexStart ?? 0, this.cancellationTokenSource.token);
|
|
90
|
+
for await (const variable of variables) {
|
|
91
|
+
childNodes.push(this.createVariableElement(variable, parent.notebook));
|
|
92
|
+
if (childNodes.length >= variablePageSize) {
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return childNodes;
|
|
98
|
+
}
|
|
99
|
+
async getRootVariables(notebook) {
|
|
100
|
+
const selectedKernel = this.notebookKernelService.getMatchingKernel(notebook).selected;
|
|
101
|
+
if (selectedKernel && selectedKernel.hasVariableProvider) {
|
|
102
|
+
const variables = selectedKernel.provideVariables(notebook.uri, undefined, 'named', 0, this.cancellationTokenSource.token);
|
|
103
|
+
return await ( variables
|
|
104
|
+
.map(variable => { return this.createVariableElement(variable, notebook); }))
|
|
105
|
+
.toPromise();
|
|
106
|
+
}
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
createVariableElement(variable, notebook) {
|
|
110
|
+
return {
|
|
111
|
+
...variable,
|
|
112
|
+
kind: 'variable',
|
|
113
|
+
notebook,
|
|
114
|
+
extHostId: variable.id,
|
|
115
|
+
id: `${variable.id}`
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { NotebookVariableDataSource };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { append, $ as $$1 } from 'vscode/vscode/vs/base/browser/dom';
|
|
2
|
+
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import 'vscode/vscode/vs/platform/list/browser/listService';
|
|
4
|
+
import { renderExpressionValue } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
5
|
+
|
|
6
|
+
const $ = $$1;
|
|
7
|
+
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
|
|
8
|
+
class NotebookVariablesDelegate {
|
|
9
|
+
getHeight(element) {
|
|
10
|
+
return 22;
|
|
11
|
+
}
|
|
12
|
+
getTemplateId(element) {
|
|
13
|
+
return NotebookVariableRenderer.ID;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
class NotebookVariableRenderer {
|
|
17
|
+
static { this.ID = 'variableElement'; }
|
|
18
|
+
get templateId() {
|
|
19
|
+
return NotebookVariableRenderer.ID;
|
|
20
|
+
}
|
|
21
|
+
renderTemplate(container) {
|
|
22
|
+
const expression = append(container, $('.expression'));
|
|
23
|
+
const name = append(expression, $('span.name'));
|
|
24
|
+
const value = append(expression, $('span.value'));
|
|
25
|
+
const template = { expression, name, value };
|
|
26
|
+
return template;
|
|
27
|
+
}
|
|
28
|
+
renderElement(element, _index, data) {
|
|
29
|
+
const text = element.element.value.trim() !== '' ? `${element.element.name}:` : element.element.name;
|
|
30
|
+
data.name.textContent = text;
|
|
31
|
+
data.name.title = element.element.type ?? '';
|
|
32
|
+
renderExpressionValue(element.element, data.value, {
|
|
33
|
+
colorize: true,
|
|
34
|
+
showHover: true,
|
|
35
|
+
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
disposeTemplate() {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class NotebookVariableAccessibilityProvider {
|
|
42
|
+
getWidgetAriaLabel() {
|
|
43
|
+
return ( localizeWithPath(
|
|
44
|
+
'vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree',
|
|
45
|
+
'debugConsole',
|
|
46
|
+
"Notebook Variables"
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
getAriaLabel(element) {
|
|
50
|
+
return ( localizeWithPath(
|
|
51
|
+
'vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree',
|
|
52
|
+
'notebookVariableAriaLabel',
|
|
53
|
+
"Variable {0}, value {1}",
|
|
54
|
+
element.name,
|
|
55
|
+
element.value
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { NotebookVariableAccessibilityProvider, NotebookVariableRenderer, NotebookVariablesDelegate };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
3
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { createAndFillInContextMenuActions } from 'vscode/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
5
|
+
import { MenuId, IMenuService } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
7
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
8
|
+
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
+
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView';
|
|
10
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
11
|
+
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding';
|
|
12
|
+
import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
13
|
+
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener';
|
|
14
|
+
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput';
|
|
15
|
+
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry';
|
|
16
|
+
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
17
|
+
import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
18
|
+
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
19
|
+
import { CONTEXT_VARIABLE_NAME, CONTEXT_VARIABLE_VALUE, CONTEXT_VARIABLE_TYPE, CONTEXT_VARIABLE_INTERFACES, CONTEXT_VARIABLE_LANGUAGE, CONTEXT_VARIABLE_EXTENSIONID } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
20
|
+
import { NotebookVariableDataSource } from './notebookVariablesDataSource.js';
|
|
21
|
+
import { NotebookVariablesDelegate, NotebookVariableRenderer, NotebookVariableAccessibilityProvider } from './notebookVariablesTree.js';
|
|
22
|
+
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
23
|
+
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
24
|
+
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
25
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
26
|
+
|
|
27
|
+
let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
28
|
+
static { this.ID = 'notebookVariablesView'; }
|
|
29
|
+
static { this.TITLE = ( localize2WithPath(
|
|
30
|
+
'vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView',
|
|
31
|
+
'notebook.notebookVariables',
|
|
32
|
+
"Notebook Variables"
|
|
33
|
+
)); }
|
|
34
|
+
constructor(options, editorService, notebookKernelService, notebookExecutionStateService, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, themeService, telemetryService, menuService) {
|
|
35
|
+
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
36
|
+
this.editorService = editorService;
|
|
37
|
+
this.notebookKernelService = notebookKernelService;
|
|
38
|
+
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
39
|
+
this.quickInputService = quickInputService;
|
|
40
|
+
this.commandService = commandService;
|
|
41
|
+
this.menuService = menuService;
|
|
42
|
+
this._register(this.editorService.onDidActiveEditorChange(this.handleActiveEditorChange.bind(this)));
|
|
43
|
+
this._register(this.notebookKernelService.onDidNotebookVariablesUpdate(this.handleVariablesChanged.bind(this)));
|
|
44
|
+
this._register(this.notebookExecutionStateService.onDidChangeExecution(this.handleExecutionStateChange.bind(this)));
|
|
45
|
+
this.setActiveNotebook();
|
|
46
|
+
this.dataSource = ( new NotebookVariableDataSource(this.notebookKernelService));
|
|
47
|
+
this.updateScheduler = ( new RunOnceScheduler(() => this.tree?.updateChildren(), 100));
|
|
48
|
+
}
|
|
49
|
+
renderBody(container) {
|
|
50
|
+
super.renderBody(container);
|
|
51
|
+
this.element.classList.add('debug-pane');
|
|
52
|
+
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'notebookVariablesTree', container, ( new NotebookVariablesDelegate()), [( new NotebookVariableRenderer())], this.dataSource, {
|
|
53
|
+
accessibilityProvider: ( new NotebookVariableAccessibilityProvider()),
|
|
54
|
+
identityProvider: { getId: (e) => e.id },
|
|
55
|
+
});
|
|
56
|
+
this.tree.layout();
|
|
57
|
+
if (this.activeNotebook) {
|
|
58
|
+
this.tree.setInput({ kind: 'root', notebook: this.activeNotebook });
|
|
59
|
+
}
|
|
60
|
+
this._register(this.tree.onContextMenu(e => this.onContextMenu(e)));
|
|
61
|
+
}
|
|
62
|
+
onContextMenu(e) {
|
|
63
|
+
if (!e.element) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const element = e.element;
|
|
67
|
+
const arg = {
|
|
68
|
+
source: ( element.notebook.uri.toString()),
|
|
69
|
+
name: element.name,
|
|
70
|
+
value: element.value,
|
|
71
|
+
type: element.type,
|
|
72
|
+
expression: element.expression,
|
|
73
|
+
language: element.language,
|
|
74
|
+
extensionId: element.extensionId
|
|
75
|
+
};
|
|
76
|
+
const actions = [];
|
|
77
|
+
const overlayedContext = this.contextKeyService.createOverlay([
|
|
78
|
+
[CONTEXT_VARIABLE_NAME.key, element.name],
|
|
79
|
+
[CONTEXT_VARIABLE_VALUE.key, element.value],
|
|
80
|
+
[CONTEXT_VARIABLE_TYPE.key, element.type],
|
|
81
|
+
[CONTEXT_VARIABLE_INTERFACES.key, element.interfaces],
|
|
82
|
+
[CONTEXT_VARIABLE_LANGUAGE.key, element.language],
|
|
83
|
+
[CONTEXT_VARIABLE_EXTENSIONID.key, element.extensionId]
|
|
84
|
+
]);
|
|
85
|
+
const menu = this.menuService.createMenu(MenuId.NotebookVariablesContext, overlayedContext);
|
|
86
|
+
createAndFillInContextMenuActions(menu, { arg, shouldForwardArgs: true }, actions);
|
|
87
|
+
menu.dispose();
|
|
88
|
+
this.contextMenuService.showContextMenu({
|
|
89
|
+
getAnchor: () => e.anchor,
|
|
90
|
+
getActions: () => actions
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
layoutBody(height, width) {
|
|
94
|
+
super.layoutBody(height, width);
|
|
95
|
+
this.tree?.layout(height, width);
|
|
96
|
+
}
|
|
97
|
+
setActiveNotebook() {
|
|
98
|
+
const current = this.activeNotebook;
|
|
99
|
+
const activeEditorPane = this.editorService.activeEditorPane;
|
|
100
|
+
if (activeEditorPane?.getId() === 'workbench.editor.notebook' || activeEditorPane?.getId() === 'workbench.editor.interactive') {
|
|
101
|
+
const notebookDocument = getNotebookEditorFromEditorPane(activeEditorPane)?.getViewModel()?.notebookDocument;
|
|
102
|
+
this.activeNotebook = notebookDocument;
|
|
103
|
+
}
|
|
104
|
+
return current !== this.activeNotebook;
|
|
105
|
+
}
|
|
106
|
+
handleActiveEditorChange() {
|
|
107
|
+
if (this.setActiveNotebook() && this.activeNotebook) {
|
|
108
|
+
this.tree?.setInput({ kind: 'root', notebook: this.activeNotebook });
|
|
109
|
+
this.updateScheduler.schedule();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
handleExecutionStateChange(event) {
|
|
113
|
+
if (this.activeNotebook) {
|
|
114
|
+
if (event.affectsNotebook(this.activeNotebook.uri)) {
|
|
115
|
+
this.dataSource.cancel();
|
|
116
|
+
if (event.changed === undefined) {
|
|
117
|
+
this.updateScheduler.schedule();
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this.updateScheduler.cancel();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
handleVariablesChanged(notebookUri) {
|
|
126
|
+
if (this.activeNotebook && ( notebookUri.toString()) === ( this.activeNotebook.uri.toString())) {
|
|
127
|
+
this.tree?.setInput({ kind: 'root', notebook: this.activeNotebook });
|
|
128
|
+
this.updateScheduler.schedule();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
NotebookVariablesView = ( __decorate([
|
|
133
|
+
( __param(1, IEditorService)),
|
|
134
|
+
( __param(2, INotebookKernelService)),
|
|
135
|
+
( __param(3, INotebookExecutionStateService)),
|
|
136
|
+
( __param(4, IKeybindingService)),
|
|
137
|
+
( __param(5, IContextMenuService)),
|
|
138
|
+
( __param(6, IContextKeyService)),
|
|
139
|
+
( __param(7, IConfigurationService)),
|
|
140
|
+
( __param(8, IInstantiationService)),
|
|
141
|
+
( __param(9, IViewDescriptorService)),
|
|
142
|
+
( __param(10, IOpenerService)),
|
|
143
|
+
( __param(11, IQuickInputService)),
|
|
144
|
+
( __param(12, ICommandService)),
|
|
145
|
+
( __param(13, IThemeService)),
|
|
146
|
+
( __param(14, ITelemetryService)),
|
|
147
|
+
( __param(15, IMenuService))
|
|
148
|
+
], NotebookVariablesView));
|
|
149
|
+
|
|
150
|
+
export { NotebookVariablesView };
|