@codingame/monaco-vscode-notebook-service-override 2.2.2 → 3.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +6 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +101 -161
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +4 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +85 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +3 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +34 -12
- 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 +55 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +39 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +17 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +3 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +565 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +744 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +28 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +351 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +41 -42
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +31 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +25 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +118 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +6 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +3 -39
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +43 -11
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +5 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
3
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
2
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
4
3
|
import { MarkerList, IMarkerNavigationService } from 'vscode/vscode/vs/editor/contrib/gotoError/browser/markerNavigationService';
|
|
5
4
|
import { CellUri } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
5
|
import { MarkerSeverity, IMarkerService } from 'vscode/vscode/vs/platform/markers/common/markers';
|
|
@@ -13,6 +12,7 @@ import { editorErrorForeground, editorWarningForeground } from 'vscode/vscode/vs
|
|
|
13
12
|
import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
14
13
|
|
|
15
14
|
let MarkerListProvider = class MarkerListProvider {
|
|
15
|
+
static { this.ID = 'workbench.contrib.markerListProvider'; }
|
|
16
16
|
constructor(_markerService, markerNavigation, _configService) {
|
|
17
17
|
this._markerService = _markerService;
|
|
18
18
|
this._configService = _configService;
|
|
@@ -87,7 +87,5 @@ NotebookMarkerDecorationContribution.__decorator = ( __decorate([
|
|
|
87
87
|
NotebookMarkerDecorationContribution = ( __decorate([
|
|
88
88
|
( __param(1, IMarkerService))
|
|
89
89
|
], NotebookMarkerDecorationContribution));
|
|
90
|
-
(
|
|
91
|
-
.as(Extensions.Workbench))
|
|
92
|
-
.registerWorkbenchContribution(MarkerListProvider, 2 );
|
|
90
|
+
registerWorkbenchContribution2(MarkerListProvider.ID, MarkerListProvider, 2 );
|
|
93
91
|
registerNotebookContribution(NotebookMarkerDecorationContribution.id, NotebookMarkerDecorationContribution);
|
|
@@ -9,6 +9,7 @@ import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/cont
|
|
|
9
9
|
import { InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
10
10
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
11
11
|
import { InlineChatController } from 'vscode/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
12
|
+
import { CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION } from '../../controller/chat/notebookChatContext.js';
|
|
12
13
|
import { NotebookCellAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, findTargetCellEditor, NotebookAction } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
13
14
|
import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
14
15
|
import { NOTEBOOK_EDITOR_CURSOR_BOUNDARY, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
@@ -141,12 +142,22 @@ registerAction2(class extends NotebookAction {
|
|
|
141
142
|
'focusFirstCell',
|
|
142
143
|
'Focus First Cell'
|
|
143
144
|
)),
|
|
144
|
-
keybinding:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
keybinding: [
|
|
146
|
+
{
|
|
147
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
148
|
+
primary: 2048 | 14 ,
|
|
149
|
+
weight: 200
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
when: ( ContextKeyExpr.and(
|
|
153
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
154
|
+
ContextKeyExpr.not(InputFocusedContextKey),
|
|
155
|
+
( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo(''))
|
|
156
|
+
)),
|
|
157
|
+
mac: { primary: 2048 | 16 },
|
|
158
|
+
weight: 200
|
|
159
|
+
}
|
|
160
|
+
],
|
|
150
161
|
});
|
|
151
162
|
}
|
|
152
163
|
async runWithContext(accessor, context) {
|
|
@@ -167,12 +178,23 @@ registerAction2(class extends NotebookAction {
|
|
|
167
178
|
'focusLastCell',
|
|
168
179
|
'Focus Last Cell'
|
|
169
180
|
)),
|
|
170
|
-
keybinding:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
181
|
+
keybinding: [
|
|
182
|
+
{
|
|
183
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
184
|
+
primary: 2048 | 13 ,
|
|
185
|
+
mac: undefined,
|
|
186
|
+
weight: 200
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
when: ( ContextKeyExpr.and(
|
|
190
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
191
|
+
ContextKeyExpr.not(InputFocusedContextKey),
|
|
192
|
+
( CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo(''))
|
|
193
|
+
)),
|
|
194
|
+
mac: { primary: 2048 | 18 },
|
|
195
|
+
weight: 200
|
|
196
|
+
}
|
|
197
|
+
],
|
|
176
198
|
});
|
|
177
199
|
}
|
|
178
200
|
async runWithContext(accessor, context) {
|
|
@@ -1,36 +1,66 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
5
|
+
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
6
|
+
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
4
7
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
8
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
6
9
|
import { VIEWLET_ID } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
7
|
-
import {
|
|
8
|
-
import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
|
|
10
|
+
import { NOTEBOOK_VARIABLE_VIEW_ENABLED } from './notebookVariableContextKeys.js';
|
|
9
11
|
import { NotebookVariablesView } from './notebookVariablesView.js';
|
|
10
|
-
import {
|
|
12
|
+
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
11
13
|
import { variablesViewIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
12
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
13
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
14
|
-
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
15
14
|
import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
15
|
+
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
16
|
+
import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
17
|
+
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
18
|
+
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
16
19
|
|
|
17
20
|
let NotebookVariables = class NotebookVariables extends Disposable {
|
|
18
|
-
constructor(
|
|
21
|
+
constructor(contextKeyService, configurationService, editorService, notebookExecutionStateService, notebookKernelService, notebookDocumentService) {
|
|
19
22
|
super();
|
|
23
|
+
this.configurationService = configurationService;
|
|
20
24
|
this.editorService = editorService;
|
|
21
25
|
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
26
|
+
this.notebookKernelService = notebookKernelService;
|
|
27
|
+
this.notebookDocumentService = notebookDocumentService;
|
|
22
28
|
this.listeners = [];
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
29
|
+
this.initialized = false;
|
|
30
|
+
this.viewEnabled = NOTEBOOK_VARIABLE_VIEW_ENABLED.bindTo(contextKeyService);
|
|
31
|
+
this.listeners.push(this.editorService.onDidActiveEditorChange(() => this.handleInitEvent()));
|
|
32
|
+
this.listeners.push(this.notebookExecutionStateService.onDidChangeExecution((e) => this.handleInitEvent(e.notebook)));
|
|
33
|
+
this.configListener = configurationService.onDidChangeConfiguration((e) => this.handleConfigChange(e));
|
|
34
|
+
}
|
|
35
|
+
handleConfigChange(e) {
|
|
36
|
+
if (e.affectsConfiguration(NotebookSetting.notebookVariablesView)) {
|
|
37
|
+
if (!this.configurationService.getValue(NotebookSetting.notebookVariablesView)) {
|
|
38
|
+
this.viewEnabled.set(false);
|
|
39
|
+
}
|
|
40
|
+
else if (this.initialized) {
|
|
41
|
+
this.viewEnabled.set(true);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
this.handleInitEvent();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
25
47
|
}
|
|
26
|
-
handleInitEvent(
|
|
27
|
-
if (configurationService.getValue(NotebookSetting.notebookVariablesView)
|
|
28
|
-
&& this.editorService.activeEditorPane?.getId() === 'workbench.editor.notebook') {
|
|
29
|
-
if (this.initializeView()) {
|
|
48
|
+
handleInitEvent(notebook) {
|
|
49
|
+
if (this.configurationService.getValue(NotebookSetting.notebookVariablesView)
|
|
50
|
+
&& (!!notebook || this.editorService.activeEditorPane?.getId() === 'workbench.editor.notebook')) {
|
|
51
|
+
if (this.hasVariableProvider(notebook) && !this.initialized && this.initializeView()) {
|
|
52
|
+
this.viewEnabled.set(true);
|
|
53
|
+
this.initialized = true;
|
|
30
54
|
this.listeners.forEach(listener => listener.dispose());
|
|
31
55
|
}
|
|
32
56
|
}
|
|
33
57
|
}
|
|
58
|
+
hasVariableProvider(notebookUri) {
|
|
59
|
+
const notebook = notebookUri ?
|
|
60
|
+
this.notebookDocumentService.getNotebookTextModel(notebookUri) :
|
|
61
|
+
getNotebookEditorFromEditorPane(this.editorService.activeEditorPane)?.getViewModel()?.notebookDocument;
|
|
62
|
+
return notebook && this.notebookKernelService.getMatchingKernel(notebook).selected?.hasVariableProvider;
|
|
63
|
+
}
|
|
34
64
|
initializeView() {
|
|
35
65
|
const debugViewContainer = ( Registry.as('workbench.registry.view.containers')).get(VIEWLET_ID);
|
|
36
66
|
if (debugViewContainer) {
|
|
@@ -42,18 +72,26 @@ let NotebookVariables = class NotebookVariables extends Disposable {
|
|
|
42
72
|
"Notebook Variables"
|
|
43
73
|
)),
|
|
44
74
|
containerIcon: variablesViewIcon, ctorDescriptor: ( new SyncDescriptor(NotebookVariablesView)),
|
|
45
|
-
order: 50, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when:
|
|
75
|
+
order: 50, weight: 5, canToggleVisibility: true, canMoveView: true, collapsed: true, when: NOTEBOOK_VARIABLE_VIEW_ENABLED,
|
|
46
76
|
};
|
|
47
77
|
viewsRegistry.registerViews([viewDescriptor], debugViewContainer);
|
|
48
78
|
return true;
|
|
49
79
|
}
|
|
50
80
|
return false;
|
|
51
81
|
}
|
|
82
|
+
dispose() {
|
|
83
|
+
super.dispose();
|
|
84
|
+
this.listeners.forEach(listener => listener.dispose());
|
|
85
|
+
this.configListener.dispose();
|
|
86
|
+
}
|
|
52
87
|
};
|
|
53
88
|
NotebookVariables = ( __decorate([
|
|
54
|
-
( __param(0,
|
|
89
|
+
( __param(0, IContextKeyService)),
|
|
55
90
|
( __param(1, IConfigurationService)),
|
|
56
|
-
( __param(2,
|
|
91
|
+
( __param(2, IEditorService)),
|
|
92
|
+
( __param(3, INotebookExecutionStateService)),
|
|
93
|
+
( __param(4, INotebookKernelService)),
|
|
94
|
+
( __param(5, INotebookService))
|
|
57
95
|
], NotebookVariables));
|
|
58
96
|
|
|
59
97
|
export { NotebookVariables };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { RunOnceScheduler } from 'vscode/vscode/vs/base/common/async';
|
|
3
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';
|
|
4
6
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
5
7
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
6
8
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
@@ -14,6 +16,7 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
14
16
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService';
|
|
15
17
|
import { ViewPane } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPane';
|
|
16
18
|
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views';
|
|
19
|
+
import { CONTEXT_VARIABLE_NAME, CONTEXT_VARIABLE_VALUE, CONTEXT_VARIABLE_TYPE, CONTEXT_VARIABLE_LANGUAGE, CONTEXT_VARIABLE_EXTENSIONID } from 'vscode/vscode/vs/workbench/contrib/debug/common/debug';
|
|
17
20
|
import { NotebookVariableDataSource } from './notebookVariablesDataSource.js';
|
|
18
21
|
import { NotebookVariablesDelegate, NotebookVariableRenderer, NotebookVariableAccessibilityProvider } from './notebookVariablesTree.js';
|
|
19
22
|
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
@@ -28,13 +31,14 @@ let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
|
28
31
|
'notebook.notebookVariables',
|
|
29
32
|
"Notebook Variables"
|
|
30
33
|
)); }
|
|
31
|
-
constructor(options, editorService, notebookKernelService, notebookExecutionStateService, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, themeService, telemetryService) {
|
|
34
|
+
constructor(options, editorService, notebookKernelService, notebookExecutionStateService, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, themeService, telemetryService, menuService) {
|
|
32
35
|
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
33
36
|
this.editorService = editorService;
|
|
34
37
|
this.notebookKernelService = notebookKernelService;
|
|
35
38
|
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
36
39
|
this.quickInputService = quickInputService;
|
|
37
40
|
this.commandService = commandService;
|
|
41
|
+
this.menuService = menuService;
|
|
38
42
|
this._register(this.editorService.onDidActiveEditorChange(this.handleActiveEditorChange.bind(this)));
|
|
39
43
|
this._register(this.notebookKernelService.onDidNotebookVariablesUpdate(this.handleVariablesChanged.bind(this)));
|
|
40
44
|
this._register(this.notebookExecutionStateService.onDidChangeExecution(this.handleExecutionStateChange.bind(this)));
|
|
@@ -44,6 +48,7 @@ let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
|
44
48
|
}
|
|
45
49
|
renderBody(container) {
|
|
46
50
|
super.renderBody(container);
|
|
51
|
+
this.element.classList.add('debug-pane');
|
|
47
52
|
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'notebookVariablesTree', container, ( new NotebookVariablesDelegate()), [( new NotebookVariableRenderer())], this.dataSource, {
|
|
48
53
|
accessibilityProvider: ( new NotebookVariableAccessibilityProvider()),
|
|
49
54
|
identityProvider: { getId: (e) => e.id },
|
|
@@ -52,6 +57,36 @@ let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
|
52
57
|
if (this.activeNotebook) {
|
|
53
58
|
this.tree.setInput({ kind: 'root', notebook: this.activeNotebook });
|
|
54
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
|
+
value: element.value,
|
|
70
|
+
type: element.type,
|
|
71
|
+
expression: element.expression,
|
|
72
|
+
language: element.language,
|
|
73
|
+
extensionId: element.extensionId
|
|
74
|
+
};
|
|
75
|
+
const actions = [];
|
|
76
|
+
const overlayedContext = this.contextKeyService.createOverlay([
|
|
77
|
+
[CONTEXT_VARIABLE_NAME.key, element.name],
|
|
78
|
+
[CONTEXT_VARIABLE_VALUE.key, element.value],
|
|
79
|
+
[CONTEXT_VARIABLE_TYPE.key, element.type],
|
|
80
|
+
[CONTEXT_VARIABLE_LANGUAGE.key, element.language],
|
|
81
|
+
[CONTEXT_VARIABLE_EXTENSIONID.key, element.extensionId]
|
|
82
|
+
]);
|
|
83
|
+
const menu = this.menuService.createMenu(MenuId.NotebookVariablesContext, overlayedContext);
|
|
84
|
+
createAndFillInContextMenuActions(menu, { arg, shouldForwardArgs: true }, actions);
|
|
85
|
+
menu.dispose();
|
|
86
|
+
this.contextMenuService.showContextMenu({
|
|
87
|
+
getAnchor: () => e.anchor,
|
|
88
|
+
getActions: () => actions
|
|
89
|
+
});
|
|
55
90
|
}
|
|
56
91
|
layoutBody(height, width) {
|
|
57
92
|
super.layoutBody(height, width);
|
|
@@ -60,7 +95,7 @@ let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
|
60
95
|
setActiveNotebook() {
|
|
61
96
|
const current = this.activeNotebook;
|
|
62
97
|
const activeEditorPane = this.editorService.activeEditorPane;
|
|
63
|
-
if (activeEditorPane
|
|
98
|
+
if (activeEditorPane?.getId() === 'workbench.editor.notebook' || activeEditorPane?.getId() === 'workbench.editor.interactive') {
|
|
64
99
|
const notebookDocument = getNotebookEditorFromEditorPane(activeEditorPane)?.getViewModel()?.notebookDocument;
|
|
65
100
|
this.activeNotebook = notebookDocument;
|
|
66
101
|
}
|
|
@@ -106,7 +141,8 @@ NotebookVariablesView = ( __decorate([
|
|
|
106
141
|
( __param(11, IQuickInputService)),
|
|
107
142
|
( __param(12, ICommandService)),
|
|
108
143
|
( __param(13, IThemeService)),
|
|
109
|
-
( __param(14, ITelemetryService))
|
|
144
|
+
( __param(14, ITelemetryService)),
|
|
145
|
+
( __param(15, IMenuService))
|
|
110
146
|
], NotebookVariablesView));
|
|
111
147
|
|
|
112
148
|
export { NotebookVariablesView };
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
1
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
2
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
3
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
7
4
|
import { NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
8
|
-
import { IWorkbenchAssignmentService } from 'vscode/vscode/vs/workbench/services/assignment/common/assignmentService';
|
|
9
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
10
5
|
|
|
11
6
|
var NotebookProfileType;
|
|
12
7
|
( (function(NotebookProfileType) {
|
|
@@ -78,40 +73,5 @@ function isSetProfileArgs(args) {
|
|
|
78
73
|
setProfileArgs.profile === NotebookProfileType.default ||
|
|
79
74
|
setProfileArgs.profile === NotebookProfileType.jupyter;
|
|
80
75
|
}
|
|
81
|
-
let NotebookProfileContribution = class NotebookProfileContribution extends Disposable {
|
|
82
|
-
constructor(configService, experimentService) {
|
|
83
|
-
super();
|
|
84
|
-
this.experimentService = experimentService;
|
|
85
|
-
if (this.experimentService) {
|
|
86
|
-
this.experimentService.getTreatment('notebookprofile').then(treatment => {
|
|
87
|
-
if (treatment === undefined) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
const focusIndicator = configService.getValue(NotebookSetting.focusIndicator);
|
|
92
|
-
const insertToolbarPosition = configService.getValue(NotebookSetting.insertToolbarLocation);
|
|
93
|
-
const globalToolbar = configService.getValue(NotebookSetting.globalToolbar);
|
|
94
|
-
const compactView = configService.getValue(NotebookSetting.compactView);
|
|
95
|
-
const showCellStatusBar = configService.getValue(NotebookSetting.showCellStatusBar);
|
|
96
|
-
const consolidatedRunButton = configService.getValue(NotebookSetting.consolidatedRunButton);
|
|
97
|
-
if (focusIndicator === 'border'
|
|
98
|
-
&& insertToolbarPosition === 'both'
|
|
99
|
-
&& globalToolbar === false
|
|
100
|
-
&& compactView === true
|
|
101
|
-
&& showCellStatusBar === 'visible'
|
|
102
|
-
&& consolidatedRunButton === true) {
|
|
103
|
-
applyProfile(configService, profiles[treatment] ?? profiles[NotebookProfileType.default]);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
NotebookProfileContribution = ( __decorate([
|
|
111
|
-
( __param(0, IConfigurationService)),
|
|
112
|
-
( __param(1, IWorkbenchAssignmentService))
|
|
113
|
-
], NotebookProfileContribution));
|
|
114
|
-
const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
|
|
115
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(NotebookProfileContribution, 2 );
|
|
116
76
|
|
|
117
|
-
export {
|
|
77
|
+
export { NotebookProfileType };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Disposable, DisposableStore, dispose } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
-
import {
|
|
3
|
-
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
2
|
+
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
4
3
|
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories';
|
|
4
|
+
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
5
5
|
import { getNotebookEditorFromEditorPane } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
6
6
|
import { registerNotebookContribution } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
7
7
|
import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
|
|
@@ -93,14 +93,11 @@ registerAction2(class extends Action2 {
|
|
|
93
93
|
constructor() {
|
|
94
94
|
super({
|
|
95
95
|
id: 'notebook.toggleLayoutTroubleshoot',
|
|
96
|
-
title:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
)),
|
|
102
|
-
original: 'Toggle Notebook Layout Troubleshoot'
|
|
103
|
-
},
|
|
96
|
+
title: ( localize2WithPath(
|
|
97
|
+
'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
|
|
98
|
+
'workbench.notebook.toggleLayoutTroubleshoot',
|
|
99
|
+
"Toggle Layout Troubleshoot"
|
|
100
|
+
)),
|
|
104
101
|
category: Categories.Developer,
|
|
105
102
|
f1: true
|
|
106
103
|
});
|
|
@@ -119,14 +116,11 @@ registerAction2(class extends Action2 {
|
|
|
119
116
|
constructor() {
|
|
120
117
|
super({
|
|
121
118
|
id: 'notebook.inspectLayout',
|
|
122
|
-
title:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
)),
|
|
128
|
-
original: 'Inspect Notebook Layout'
|
|
129
|
-
},
|
|
119
|
+
title: ( localize2WithPath(
|
|
120
|
+
'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
|
|
121
|
+
'workbench.notebook.inspectLayout',
|
|
122
|
+
"Inspect Notebook Layout"
|
|
123
|
+
)),
|
|
130
124
|
category: Categories.Developer,
|
|
131
125
|
f1: true
|
|
132
126
|
});
|
|
@@ -147,14 +141,11 @@ registerAction2(class extends Action2 {
|
|
|
147
141
|
constructor() {
|
|
148
142
|
super({
|
|
149
143
|
id: 'notebook.clearNotebookEdtitorTypeCache',
|
|
150
|
-
title:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
)),
|
|
156
|
-
original: 'Clear Notebook Editor Cache'
|
|
157
|
-
},
|
|
144
|
+
title: ( localize2WithPath(
|
|
145
|
+
'vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout',
|
|
146
|
+
'workbench.notebook.clearNotebookEdtitorTypeCache',
|
|
147
|
+
"Clear Notebook Editor Type Cache"
|
|
148
|
+
)),
|
|
158
149
|
category: Categories.Developer,
|
|
159
150
|
f1: true
|
|
160
151
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import {
|
|
4
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
3
|
+
import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
4
|
import { CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
5
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
7
6
|
import { getNotebookEditorFromEditorPane, CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
8
7
|
import { UndoCommand, RedoCommand } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
9
8
|
|
|
10
9
|
let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Disposable {
|
|
10
|
+
static { this.ID = 'workbench.contrib.notebookUndoRedo'; }
|
|
11
11
|
constructor(_editorService) {
|
|
12
12
|
super();
|
|
13
13
|
this._editorService = _editorService;
|
|
@@ -53,5 +53,4 @@ let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Di
|
|
|
53
53
|
NotebookUndoRedoContribution = ( __decorate([
|
|
54
54
|
( __param(0, IEditorService))
|
|
55
55
|
], NotebookUndoRedoContribution));
|
|
56
|
-
|
|
57
|
-
workbenchContributionsRegistry.registerWorkbenchContribution(NotebookUndoRedoContribution, 2 );
|
|
56
|
+
registerWorkbenchContribution2(NotebookUndoRedoContribution.ID, NotebookUndoRedoContribution, 2 );
|