@codingame/monaco-vscode-notebook-service-override 4.5.2 → 5.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 +13 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +39 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +22 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +37 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +75 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +13 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +68 -44
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +9 -4
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-notebook-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
32
|
+
"vscode": "npm:@codingame/monaco-vscode-api@5.0.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -25,8 +25,8 @@ import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
|
25
25
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/configuration';
|
|
26
26
|
import { OUTPUT_MODE_ID, LOG_MODE_ID } from 'vscode/vscode/vs/workbench/services/output/common/output';
|
|
27
27
|
import { SEARCH_RESULT_LANGUAGE_ID } from 'vscode/vscode/vs/workbench/services/search/common/search';
|
|
28
|
-
import { setupCustomHover } from 'vscode/vscode/vs/base/browser/ui/hover/updatableHoverWidget';
|
|
29
28
|
import { getDefaultHoverDelegate } from 'vscode/vscode/vs/base/browser/ui/hover/hoverDelegateFactory';
|
|
29
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
30
30
|
|
|
31
31
|
const _moduleId = "vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint";
|
|
32
32
|
const $ = $$1;
|
|
@@ -48,11 +48,12 @@ const $ = $$1;
|
|
|
48
48
|
const emptyTextEditorHintSetting = 'workbench.editor.empty.hint';
|
|
49
49
|
let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
|
|
50
50
|
static { this.ID = 'editor.contrib.emptyTextEditorHint'; }
|
|
51
|
-
constructor(editor, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
|
|
51
|
+
constructor(editor, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
|
|
52
52
|
this.editor = editor;
|
|
53
53
|
this.editorGroupsService = editorGroupsService;
|
|
54
54
|
this.commandService = commandService;
|
|
55
55
|
this.configurationService = configurationService;
|
|
56
|
+
this.hoverService = hoverService;
|
|
56
57
|
this.keybindingService = keybindingService;
|
|
57
58
|
this.inlineChatSessionService = inlineChatSessionService;
|
|
58
59
|
this.inlineChatService = inlineChatService;
|
|
@@ -127,6 +128,7 @@ let EmptyTextEditorHintContribution = class EmptyTextEditorHintContribution {
|
|
|
127
128
|
this.editorGroupsService,
|
|
128
129
|
this.commandService,
|
|
129
130
|
this.configurationService,
|
|
131
|
+
this.hoverService,
|
|
130
132
|
this.keybindingService,
|
|
131
133
|
this.inlineChatService,
|
|
132
134
|
this.telemetryService,
|
|
@@ -147,20 +149,22 @@ EmptyTextEditorHintContribution = ( (__decorate([
|
|
|
147
149
|
( (__param(1, IEditorGroupsService))),
|
|
148
150
|
( (__param(2, ICommandService))),
|
|
149
151
|
( (__param(3, IConfigurationService))),
|
|
150
|
-
( (__param(4,
|
|
151
|
-
( (__param(5,
|
|
152
|
-
( (__param(6,
|
|
153
|
-
( (__param(7,
|
|
154
|
-
( (__param(8,
|
|
152
|
+
( (__param(4, IHoverService))),
|
|
153
|
+
( (__param(5, IKeybindingService))),
|
|
154
|
+
( (__param(6, IInlineChatSessionService))),
|
|
155
|
+
( (__param(7, IInlineChatService))),
|
|
156
|
+
( (__param(8, ITelemetryService))),
|
|
157
|
+
( (__param(9, IProductService)))
|
|
155
158
|
], EmptyTextEditorHintContribution)));
|
|
156
159
|
class EmptyTextEditorHintContentWidget {
|
|
157
160
|
static { this.ID = 'editor.widget.emptyHint'; }
|
|
158
|
-
constructor(editor, options, editorGroupsService, commandService, configurationService, keybindingService, inlineChatService, telemetryService, productService) {
|
|
161
|
+
constructor(editor, options, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatService, telemetryService, productService) {
|
|
159
162
|
this.editor = editor;
|
|
160
163
|
this.options = options;
|
|
161
164
|
this.editorGroupsService = editorGroupsService;
|
|
162
165
|
this.commandService = commandService;
|
|
163
166
|
this.configurationService = configurationService;
|
|
167
|
+
this.hoverService = hoverService;
|
|
164
168
|
this.keybindingService = keybindingService;
|
|
165
169
|
this.inlineChatService = inlineChatService;
|
|
166
170
|
this.telemetryService = telemetryService;
|
|
@@ -336,7 +340,7 @@ class EmptyTextEditorHintContentWidget {
|
|
|
336
340
|
anchor.style.cursor = 'pointer';
|
|
337
341
|
const id = keybindingsLookup.shift();
|
|
338
342
|
const title = id && this.keybindingService.lookupKeybinding(id)?.getLabel();
|
|
339
|
-
hintHandler.disposables.add(
|
|
343
|
+
hintHandler.disposables.add(this.hoverService.setupUpdatableHover(getDefaultHoverDelegate('mouse'), anchor, title ?? ''));
|
|
340
344
|
}
|
|
341
345
|
return { hintElement, ariaLabel };
|
|
342
346
|
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { Delayer } from 'vscode/vscode/vs/base/common/async';
|
|
2
3
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
4
|
import { Range } from 'vscode/vscode/vs/editor/common/core/range';
|
|
4
5
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
@@ -22,11 +23,12 @@ let PausedCellDecorationContribution = class PausedCellDecorationContribution ex
|
|
|
22
23
|
this._currentTopDecorations = [];
|
|
23
24
|
this._currentOtherDecorations = [];
|
|
24
25
|
this._executingCellDecorations = [];
|
|
26
|
+
const delayer = this._register(( new Delayer(200)));
|
|
25
27
|
this._register(_debugService.getModel().onDidChangeCallStack(() => this.updateExecutionDecorations()));
|
|
26
28
|
this._register(_debugService.getViewModel().onDidFocusStackFrame(() => this.updateExecutionDecorations()));
|
|
27
29
|
this._register(_notebookExecutionStateService.onDidChangeExecution(e => {
|
|
28
30
|
if (e.type === NotebookExecutionType.cell && this._notebookEditor.textModel && e.affectsNotebook(this._notebookEditor.textModel.uri)) {
|
|
29
|
-
this.updateExecutionDecorations();
|
|
31
|
+
delayer.trigger(() => this.updateExecutionDecorations());
|
|
30
32
|
}
|
|
31
33
|
}));
|
|
32
34
|
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
|
3
3
|
import { registerEditorContribution } from 'vscode/vscode/vs/editor/browser/editorExtensions';
|
|
4
4
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
5
5
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
6
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
6
7
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
7
8
|
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
8
9
|
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
@@ -15,8 +16,8 @@ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/commo
|
|
|
15
16
|
|
|
16
17
|
let EmptyCellEditorHintContribution = class EmptyCellEditorHintContribution extends EmptyTextEditorHintContribution {
|
|
17
18
|
static { this.CONTRIB_ID = 'notebook.editor.contrib.emptyCellEditorHint'; }
|
|
18
|
-
constructor(editor, _editorService, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
|
|
19
|
-
super(editor, editorGroupsService, commandService, configurationService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService);
|
|
19
|
+
constructor(editor, _editorService, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService) {
|
|
20
|
+
super(editor, editorGroupsService, commandService, configurationService, hoverService, keybindingService, inlineChatSessionService, inlineChatService, telemetryService, productService);
|
|
20
21
|
this._editorService = _editorService;
|
|
21
22
|
const activeEditor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
22
23
|
if (!activeEditor) {
|
|
@@ -56,11 +57,12 @@ EmptyCellEditorHintContribution = ( __decorate([
|
|
|
56
57
|
( __param(2, IEditorGroupsService)),
|
|
57
58
|
( __param(3, ICommandService)),
|
|
58
59
|
( __param(4, IConfigurationService)),
|
|
59
|
-
( __param(5,
|
|
60
|
-
( __param(6,
|
|
61
|
-
( __param(7,
|
|
62
|
-
( __param(8,
|
|
63
|
-
( __param(9,
|
|
60
|
+
( __param(5, IHoverService)),
|
|
61
|
+
( __param(6, IKeybindingService)),
|
|
62
|
+
( __param(7, IInlineChatSessionService)),
|
|
63
|
+
( __param(8, IInlineChatService)),
|
|
64
|
+
( __param(9, ITelemetryService)),
|
|
65
|
+
( __param(10, IProductService))
|
|
64
66
|
], EmptyCellEditorHintContribution));
|
|
65
67
|
registerEditorContribution(EmptyCellEditorHintContribution.CONTRIB_ID, EmptyCellEditorHintContribution, 0 );
|
|
66
68
|
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js
CHANGED
|
@@ -241,9 +241,9 @@ let NotebookIndentationStatus = class NotebookIndentationStatus extends Disposab
|
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
const cellEditorOverridesRaw = editor.notebookOptions.getDisplayOptions().editorOptionsCustomizations;
|
|
244
|
-
const indentSize = cellEditorOverridesRaw['editor.indentSize'] ?? cellOptions?.indentSize;
|
|
245
|
-
const insertSpaces = cellEditorOverridesRaw['editor.insertSpaces'] ?? cellOptions?.
|
|
246
|
-
const tabSize = cellEditorOverridesRaw['editor.tabSize'] ?? cellOptions?.
|
|
244
|
+
const indentSize = cellEditorOverridesRaw?.['editor.indentSize'] ?? cellOptions?.indentSize;
|
|
245
|
+
const insertSpaces = cellEditorOverridesRaw?.['editor.insertSpaces'] ?? cellOptions?.insertSpaces;
|
|
246
|
+
const tabSize = cellEditorOverridesRaw?.['editor.tabSize'] ?? cellOptions?.tabSize;
|
|
247
247
|
const width = typeof indentSize === 'number' ? indentSize : tabSize;
|
|
248
248
|
const message = insertSpaces ? `Spaces: ${width}` : `Tab Size: ${width}`;
|
|
249
249
|
const newText = message;
|
|
@@ -3,7 +3,7 @@ import { EditorExtensionsRegistry } from 'vscode/vscode/vs/editor/browser/editor
|
|
|
3
3
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
4
4
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
6
|
-
import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
|
+
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
7
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
8
8
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
9
|
import { InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
@@ -13,7 +13,7 @@ import { CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION } from 'vscode/vscode/vs/workben
|
|
|
13
13
|
import { NotebookCellAction, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, findTargetCellEditor, NotebookAction } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
14
14
|
import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
15
15
|
import { NOTEBOOK_EDITOR_CURSOR_BOUNDARY, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
-
import { NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_TYPE, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CURSOR_NAVIGATION_MODE, NOTEBOOK_OUTPUT_FOCUSED, NOTEBOOK_CELL_HAS_OUTPUTS } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
16
|
+
import { NOTEBOOK_OUTPUT_INPUT_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_TYPE, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CURSOR_NAVIGATION_MODE, NOTEBOOK_OUTPUT_FOCUSED, NOTEBOOK_CELL_HAS_OUTPUTS } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
17
17
|
|
|
18
18
|
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/navigation/arrow";
|
|
19
19
|
const NOTEBOOK_FOCUS_TOP = 'notebook.focusTop';
|
|
@@ -27,11 +27,36 @@ const NOTEBOOK_CURSOR_PAGEUP_COMMAND_ID = 'notebook.cell.cursorPageUp';
|
|
|
27
27
|
const NOTEBOOK_CURSOR_PAGEUP_SELECT_COMMAND_ID = 'notebook.cell.cursorPageUpSelect';
|
|
28
28
|
const NOTEBOOK_CURSOR_PAGEDOWN_COMMAND_ID = 'notebook.cell.cursorPageDown';
|
|
29
29
|
const NOTEBOOK_CURSOR_PAGEDOWN_SELECT_COMMAND_ID = 'notebook.cell.cursorPageDownSelect';
|
|
30
|
+
registerAction2(class extends Action2 {
|
|
31
|
+
constructor() {
|
|
32
|
+
super({
|
|
33
|
+
id: 'notebook.cell.nullAction',
|
|
34
|
+
title: ( localizeWithPath(
|
|
35
|
+
_moduleId,
|
|
36
|
+
0,
|
|
37
|
+
"Keypresses that should be handled by the focused element in the cell output."
|
|
38
|
+
)),
|
|
39
|
+
keybinding: [{
|
|
40
|
+
when: NOTEBOOK_OUTPUT_INPUT_FOCUSED,
|
|
41
|
+
primary: 18 ,
|
|
42
|
+
weight: 200 + 1
|
|
43
|
+
}, {
|
|
44
|
+
when: NOTEBOOK_OUTPUT_INPUT_FOCUSED,
|
|
45
|
+
primary: 16 ,
|
|
46
|
+
weight: 200 + 1
|
|
47
|
+
}],
|
|
48
|
+
f1: false
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
run() {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
30
55
|
registerAction2(class FocusNextCellAction extends NotebookCellAction {
|
|
31
56
|
constructor() {
|
|
32
57
|
super({
|
|
33
58
|
id: NOTEBOOK_FOCUS_NEXT_EDITOR,
|
|
34
|
-
title: ( localizeWithPath(_moduleId,
|
|
59
|
+
title: ( localizeWithPath(_moduleId, 1, 'Focus Next Cell Editor')),
|
|
35
60
|
keybinding: [
|
|
36
61
|
{
|
|
37
62
|
when: ( (ContextKeyExpr.and(
|
|
@@ -106,7 +131,7 @@ registerAction2(class FocusPreviousCellAction extends NotebookCellAction {
|
|
|
106
131
|
constructor() {
|
|
107
132
|
super({
|
|
108
133
|
id: NOTEBOOK_FOCUS_PREVIOUS_EDITOR,
|
|
109
|
-
title: ( localizeWithPath(_moduleId,
|
|
134
|
+
title: ( localizeWithPath(_moduleId, 2, 'Focus Previous Cell Editor')),
|
|
110
135
|
keybinding: [
|
|
111
136
|
{
|
|
112
137
|
when: ( (ContextKeyExpr.and(
|
|
@@ -172,7 +197,7 @@ registerAction2(class extends NotebookAction {
|
|
|
172
197
|
constructor() {
|
|
173
198
|
super({
|
|
174
199
|
id: NOTEBOOK_FOCUS_TOP,
|
|
175
|
-
title: ( localizeWithPath(_moduleId,
|
|
200
|
+
title: ( localizeWithPath(_moduleId, 3, 'Focus First Cell')),
|
|
176
201
|
keybinding: [
|
|
177
202
|
{
|
|
178
203
|
when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
|
|
@@ -204,7 +229,7 @@ registerAction2(class extends NotebookAction {
|
|
|
204
229
|
constructor() {
|
|
205
230
|
super({
|
|
206
231
|
id: NOTEBOOK_FOCUS_BOTTOM,
|
|
207
|
-
title: ( localizeWithPath(_moduleId,
|
|
232
|
+
title: ( localizeWithPath(_moduleId, 4, 'Focus Last Cell')),
|
|
208
233
|
keybinding: [
|
|
209
234
|
{
|
|
210
235
|
when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey)))),
|
|
@@ -241,7 +266,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
241
266
|
constructor() {
|
|
242
267
|
super({
|
|
243
268
|
id: FOCUS_IN_OUTPUT_COMMAND_ID,
|
|
244
|
-
title: ( localizeWithPath(_moduleId,
|
|
269
|
+
title: ( localizeWithPath(_moduleId, 5, 'Focus In Active Cell Output')),
|
|
245
270
|
keybinding: {
|
|
246
271
|
when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_HAS_OUTPUTS))),
|
|
247
272
|
primary: 2048 | 18 ,
|
|
@@ -260,7 +285,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
260
285
|
constructor() {
|
|
261
286
|
super({
|
|
262
287
|
id: FOCUS_OUT_OUTPUT_COMMAND_ID,
|
|
263
|
-
title: ( localizeWithPath(_moduleId,
|
|
288
|
+
title: ( localizeWithPath(_moduleId, 6, 'Focus Out Active Cell Output')),
|
|
264
289
|
keybinding: {
|
|
265
290
|
when: ( (ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED))),
|
|
266
291
|
primary: 2048 | 16 ,
|
|
@@ -279,7 +304,7 @@ registerAction2(class CenterActiveCellAction extends NotebookCellAction {
|
|
|
279
304
|
constructor() {
|
|
280
305
|
super({
|
|
281
306
|
id: CENTER_ACTIVE_CELL,
|
|
282
|
-
title: ( localizeWithPath(_moduleId,
|
|
307
|
+
title: ( localizeWithPath(_moduleId, 7, "Center Active Cell")),
|
|
283
308
|
keybinding: {
|
|
284
309
|
when: NOTEBOOK_EDITOR_FOCUSED,
|
|
285
310
|
primary: 2048 | 42 ,
|
|
@@ -298,7 +323,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
298
323
|
constructor() {
|
|
299
324
|
super({
|
|
300
325
|
id: NOTEBOOK_CURSOR_PAGEUP_COMMAND_ID,
|
|
301
|
-
title: ( localizeWithPath(_moduleId,
|
|
326
|
+
title: ( localizeWithPath(_moduleId, 8, "Cell Cursor Page Up")),
|
|
302
327
|
keybinding: [
|
|
303
328
|
{
|
|
304
329
|
when: ( (ContextKeyExpr.and(
|
|
@@ -320,7 +345,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
320
345
|
constructor() {
|
|
321
346
|
super({
|
|
322
347
|
id: NOTEBOOK_CURSOR_PAGEUP_SELECT_COMMAND_ID,
|
|
323
|
-
title: ( localizeWithPath(_moduleId,
|
|
348
|
+
title: ( localizeWithPath(_moduleId, 9, "Cell Cursor Page Up Select")),
|
|
324
349
|
keybinding: [
|
|
325
350
|
{
|
|
326
351
|
when: ( (ContextKeyExpr.and(
|
|
@@ -343,7 +368,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
343
368
|
constructor() {
|
|
344
369
|
super({
|
|
345
370
|
id: NOTEBOOK_CURSOR_PAGEDOWN_COMMAND_ID,
|
|
346
|
-
title: ( localizeWithPath(_moduleId,
|
|
371
|
+
title: ( localizeWithPath(_moduleId, 10, "Cell Cursor Page Down")),
|
|
347
372
|
keybinding: [
|
|
348
373
|
{
|
|
349
374
|
when: ( (ContextKeyExpr.and(
|
|
@@ -365,7 +390,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
365
390
|
constructor() {
|
|
366
391
|
super({
|
|
367
392
|
id: NOTEBOOK_CURSOR_PAGEDOWN_SELECT_COMMAND_ID,
|
|
368
|
-
title: ( localizeWithPath(_moduleId,
|
|
393
|
+
title: ( localizeWithPath(_moduleId, 11, "Cell Cursor Page Down Select")),
|
|
369
394
|
keybinding: [
|
|
370
395
|
{
|
|
371
396
|
when: ( (ContextKeyExpr.and(
|
|
@@ -400,7 +425,7 @@ function getPageSize(context) {
|
|
|
400
425
|
default: true,
|
|
401
426
|
markdownDescription: ( localizeWithPath(
|
|
402
427
|
_moduleId,
|
|
403
|
-
|
|
428
|
+
12,
|
|
404
429
|
"When enabled cursor can navigate to the next/previous cell when the current cursor in the cell editor is at the first/last line."
|
|
405
430
|
))
|
|
406
431
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
1
2
|
import { $ as $$1, append } from 'vscode/vscode/vs/base/browser/dom';
|
|
3
|
+
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
4
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
3
6
|
import 'vscode/vscode/vs/platform/list/browser/listService';
|
|
4
7
|
import { renderExpressionValue } from 'vscode/vscode/vs/workbench/contrib/debug/browser/baseDebugView';
|
|
5
8
|
|
|
9
|
+
var NotebookVariableRenderer_1;
|
|
6
10
|
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree";
|
|
7
11
|
const $ = $$1;
|
|
8
12
|
const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024;
|
|
@@ -14,16 +18,20 @@ class NotebookVariablesDelegate {
|
|
|
14
18
|
return NotebookVariableRenderer.ID;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
|
-
class NotebookVariableRenderer {
|
|
21
|
+
let NotebookVariableRenderer = class NotebookVariableRenderer {
|
|
22
|
+
static { NotebookVariableRenderer_1 = this; }
|
|
18
23
|
static { this.ID = 'variableElement'; }
|
|
19
24
|
get templateId() {
|
|
20
|
-
return
|
|
25
|
+
return NotebookVariableRenderer_1.ID;
|
|
26
|
+
}
|
|
27
|
+
constructor(_hoverService) {
|
|
28
|
+
this._hoverService = _hoverService;
|
|
21
29
|
}
|
|
22
30
|
renderTemplate(container) {
|
|
23
31
|
const expression = append(container, $('.expression'));
|
|
24
32
|
const name = append(expression, $('span.name'));
|
|
25
33
|
const value = append(expression, $('span.value'));
|
|
26
|
-
const template = { expression, name, value };
|
|
34
|
+
const template = { expression, name, value, elementDisposables: ( (new DisposableStore())) };
|
|
27
35
|
return template;
|
|
28
36
|
}
|
|
29
37
|
renderElement(element, _index, data) {
|
|
@@ -32,13 +40,20 @@ class NotebookVariableRenderer {
|
|
|
32
40
|
data.name.title = element.element.type ?? '';
|
|
33
41
|
renderExpressionValue(element.element, data.value, {
|
|
34
42
|
colorize: true,
|
|
35
|
-
|
|
43
|
+
hover: data.elementDisposables,
|
|
36
44
|
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET
|
|
37
|
-
});
|
|
45
|
+
}, this._hoverService);
|
|
38
46
|
}
|
|
39
|
-
|
|
47
|
+
disposeElement(element, index, templateData, height) {
|
|
48
|
+
templateData.elementDisposables.clear();
|
|
40
49
|
}
|
|
41
|
-
|
|
50
|
+
disposeTemplate(templateData) {
|
|
51
|
+
templateData.elementDisposables.dispose();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
NotebookVariableRenderer = NotebookVariableRenderer_1 = ( (__decorate([
|
|
55
|
+
( (__param(0, IHoverService)))
|
|
56
|
+
], NotebookVariableRenderer)));
|
|
42
57
|
class NotebookVariableAccessibilityProvider {
|
|
43
58
|
getWidgetAriaLabel() {
|
|
44
59
|
return ( localizeWithPath(_moduleId, 0, "Notebook Variables"));
|
|
@@ -8,6 +8,7 @@ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/comma
|
|
|
8
8
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
9
9
|
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
10
10
|
import { IContextMenuService } from 'vscode/vscode/vs/platform/contextview/browser/contextView.service';
|
|
11
|
+
import { IHoverService } from 'vscode/vscode/vs/platform/hover/browser/hover.service';
|
|
11
12
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
13
|
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
13
14
|
import { WorkbenchAsyncDataTree } from 'vscode/vscode/vs/platform/list/browser/listService';
|
|
@@ -29,8 +30,8 @@ const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/notebookVariabl
|
|
|
29
30
|
let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
30
31
|
static { this.ID = 'notebookVariablesView'; }
|
|
31
32
|
static { this.TITLE = ( localize2WithPath(_moduleId, 0, "Notebook Variables")); }
|
|
32
|
-
constructor(options, editorService, notebookKernelService, notebookExecutionStateService, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, themeService, telemetryService, menuService) {
|
|
33
|
-
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
|
|
33
|
+
constructor(options, editorService, notebookKernelService, notebookExecutionStateService, keybindingService, contextMenuService, contextKeyService, configurationService, instantiationService, viewDescriptorService, openerService, quickInputService, commandService, themeService, telemetryService, hoverService, menuService) {
|
|
34
|
+
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService, hoverService);
|
|
34
35
|
this.editorService = editorService;
|
|
35
36
|
this.notebookKernelService = notebookKernelService;
|
|
36
37
|
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
@@ -47,7 +48,7 @@ let NotebookVariablesView = class NotebookVariablesView extends ViewPane {
|
|
|
47
48
|
renderBody(container) {
|
|
48
49
|
super.renderBody(container);
|
|
49
50
|
this.element.classList.add('debug-pane');
|
|
50
|
-
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'notebookVariablesTree', container, ( (new NotebookVariablesDelegate())), [( (new NotebookVariableRenderer()))], this.dataSource, {
|
|
51
|
+
this.tree = this.instantiationService.createInstance(WorkbenchAsyncDataTree, 'notebookVariablesTree', container, ( (new NotebookVariablesDelegate())), [( (new NotebookVariableRenderer(this.hoverService)))], this.dataSource, {
|
|
51
52
|
accessibilityProvider: ( (new NotebookVariableAccessibilityProvider())),
|
|
52
53
|
identityProvider: { getId: (e) => e.id },
|
|
53
54
|
});
|
|
@@ -142,7 +143,8 @@ NotebookVariablesView = ( (__decorate([
|
|
|
142
143
|
( (__param(12, ICommandService))),
|
|
143
144
|
( (__param(13, IThemeService))),
|
|
144
145
|
( (__param(14, ITelemetryService))),
|
|
145
|
-
( (__param(15,
|
|
146
|
+
( (__param(15, IHoverService))),
|
|
147
|
+
( (__param(16, IMenuService)))
|
|
146
148
|
], NotebookVariablesView)));
|
|
147
149
|
|
|
148
150
|
export { NotebookVariablesView };
|
|
@@ -27,7 +27,6 @@ import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
|
|
|
27
27
|
import { IThemeService } from 'vscode/vscode/vs/platform/theme/common/themeService.service';
|
|
28
28
|
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
29
29
|
import { NotebookEditor } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditor';
|
|
30
|
-
import { NotebookCellOutlineProvider } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider';
|
|
31
30
|
import { CellKind, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
32
31
|
import { SIDE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
33
32
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
@@ -44,6 +43,7 @@ import { disposableTimeout } from 'vscode/vscode/vs/base/common/async';
|
|
|
44
43
|
import { IOutlinePane } from 'vscode/vscode/vs/workbench/contrib/outline/browser/outline';
|
|
45
44
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
46
45
|
import { NOTEBOOK_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
46
|
+
import { INotebookCellOutlineProviderFactory } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProviderFactory.service';
|
|
47
47
|
|
|
48
48
|
var NotebookCellOutline_1;
|
|
49
49
|
const _moduleId = "vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline";
|
|
@@ -154,7 +154,7 @@ let NotebookOutlineRenderer = class NotebookOutlineRenderer {
|
|
|
154
154
|
const scopedContextKeyService = template.elementDisposables.add(this._contextKeyService.createScoped(template.container));
|
|
155
155
|
NotebookOutlineContext.CellKind.bindTo(scopedContextKeyService).set(isCodeCell ? CellKind.Code : CellKind.Markup);
|
|
156
156
|
NotebookOutlineContext.CellHasChildren.bindTo(scopedContextKeyService).set(length > 0);
|
|
157
|
-
NotebookOutlineContext.CellHasHeader.bindTo(scopedContextKeyService).set(node.element.level !== 7);
|
|
157
|
+
NotebookOutlineContext.CellHasHeader.bindTo(scopedContextKeyService).set(node.element.level !== 7 );
|
|
158
158
|
NotebookOutlineContext.OutlineElementTarget.bindTo(scopedContextKeyService).set(this._target);
|
|
159
159
|
this.setupFolding(isCodeCell, nbViewModel, scopedContextKeyService, template, nbCell);
|
|
160
160
|
const outlineEntryToolbar = template.elementDisposables.add(( (new ToolBar(template.actionMenu, this._contextMenuService, {
|
|
@@ -260,8 +260,9 @@ class NotebookOutlineVirtualDelegate {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
let NotebookQuickPickProvider = class NotebookQuickPickProvider {
|
|
263
|
-
constructor(_getEntries, _themeService) {
|
|
263
|
+
constructor(_getEntries, _configurationService, _themeService) {
|
|
264
264
|
this._getEntries = _getEntries;
|
|
265
|
+
this._configurationService = _configurationService;
|
|
265
266
|
this._themeService = _themeService;
|
|
266
267
|
}
|
|
267
268
|
getQuickPickElements() {
|
|
@@ -271,7 +272,21 @@ let NotebookQuickPickProvider = class NotebookQuickPickProvider {
|
|
|
271
272
|
}
|
|
272
273
|
const result = [];
|
|
273
274
|
const { hasFileIcons } = this._themeService.getFileIconTheme();
|
|
274
|
-
|
|
275
|
+
const showSymbols = this._configurationService.getValue(NotebookSetting.gotoSymbolsAllSymbols);
|
|
276
|
+
const isSymbol = (element) => !!element.symbolKind;
|
|
277
|
+
const isCodeCell = (element) => ((element.cell.cellKind === CellKind.Code && element.level === 7) );
|
|
278
|
+
for (let i = 0; i < bucket.length; i++) {
|
|
279
|
+
const element = bucket[i];
|
|
280
|
+
const nextElement = bucket[i + 1];
|
|
281
|
+
if (!showSymbols
|
|
282
|
+
&& isSymbol(element)) {
|
|
283
|
+
continue;
|
|
284
|
+
}
|
|
285
|
+
if (showSymbols
|
|
286
|
+
&& isCodeCell(element)
|
|
287
|
+
&& nextElement && isSymbol(nextElement)) {
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
275
290
|
const useFileIcon = hasFileIcons && !element.symbolKind;
|
|
276
291
|
result.push({
|
|
277
292
|
element,
|
|
@@ -284,7 +299,8 @@ let NotebookQuickPickProvider = class NotebookQuickPickProvider {
|
|
|
284
299
|
}
|
|
285
300
|
};
|
|
286
301
|
NotebookQuickPickProvider = ( (__decorate([
|
|
287
|
-
( (__param(1,
|
|
302
|
+
( (__param(1, IConfigurationService))),
|
|
303
|
+
( (__param(2, IThemeService)))
|
|
288
304
|
], NotebookQuickPickProvider)));
|
|
289
305
|
class NotebookComparator {
|
|
290
306
|
constructor() {
|
|
@@ -302,10 +318,10 @@ class NotebookComparator {
|
|
|
302
318
|
}
|
|
303
319
|
let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
304
320
|
get entries() {
|
|
305
|
-
return this.
|
|
321
|
+
return this._outlineProviderReference?.object?.entries ?? [];
|
|
306
322
|
}
|
|
307
323
|
get activeElement() {
|
|
308
|
-
return this.
|
|
324
|
+
return this._outlineProviderReference?.object?.activeElement;
|
|
309
325
|
}
|
|
310
326
|
constructor(_editor, _target, instantiationService, _editorService, _configurationService) {
|
|
311
327
|
this._editor = _editor;
|
|
@@ -319,15 +335,15 @@ let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
|
319
335
|
const installSelectionListener = () => {
|
|
320
336
|
const notebookEditor = _editor.getControl();
|
|
321
337
|
if (!notebookEditor?.hasModel()) {
|
|
322
|
-
this.
|
|
323
|
-
this.
|
|
338
|
+
this._outlineProviderReference?.dispose();
|
|
339
|
+
this._outlineProviderReference = undefined;
|
|
324
340
|
this._localDisposables.clear();
|
|
325
341
|
}
|
|
326
342
|
else {
|
|
327
|
-
this.
|
|
343
|
+
this._outlineProviderReference?.dispose();
|
|
328
344
|
this._localDisposables.clear();
|
|
329
|
-
this.
|
|
330
|
-
this._localDisposables.add(this.
|
|
345
|
+
this._outlineProviderReference = instantiationService.invokeFunction((accessor) => accessor.get(INotebookCellOutlineProviderFactory).getOrCreate(notebookEditor, _target));
|
|
346
|
+
this._localDisposables.add(this._outlineProviderReference.object.onDidChange(e => {
|
|
331
347
|
this._onDidChange.fire(e);
|
|
332
348
|
}));
|
|
333
349
|
}
|
|
@@ -364,7 +380,7 @@ let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
|
364
380
|
return result;
|
|
365
381
|
}
|
|
366
382
|
},
|
|
367
|
-
quickPickDataSource: instantiationService.createInstance(NotebookQuickPickProvider, () => (this.
|
|
383
|
+
quickPickDataSource: instantiationService.createInstance(NotebookQuickPickProvider, () => (this._outlineProviderReference?.object?.entries ?? [])),
|
|
368
384
|
treeDataSource,
|
|
369
385
|
delegate,
|
|
370
386
|
renderers,
|
|
@@ -376,12 +392,12 @@ let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
|
376
392
|
const showCodeCells = configurationService.getValue(NotebookSetting.outlineShowCodeCells);
|
|
377
393
|
const showCodeCellSymbols = configurationService.getValue(NotebookSetting.outlineShowCodeCellSymbols);
|
|
378
394
|
const showMarkdownHeadersOnly = configurationService.getValue(NotebookSetting.outlineShowMarkdownHeadersOnly);
|
|
379
|
-
for (const entry of parent instanceof NotebookCellOutline_1 ? (this.
|
|
395
|
+
for (const entry of parent instanceof NotebookCellOutline_1 ? (this._outlineProviderReference?.object?.entries ?? []) : parent.children) {
|
|
380
396
|
if (entry.cell.cellKind === CellKind.Markup) {
|
|
381
397
|
if (!showMarkdownHeadersOnly) {
|
|
382
398
|
yield entry;
|
|
383
399
|
}
|
|
384
|
-
else if (entry.level < 7) {
|
|
400
|
+
else if (entry.level < 7 ) {
|
|
385
401
|
yield entry;
|
|
386
402
|
}
|
|
387
403
|
}
|
|
@@ -389,20 +405,20 @@ let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
|
389
405
|
if (showCodeCellSymbols) {
|
|
390
406
|
yield entry;
|
|
391
407
|
}
|
|
392
|
-
else if (entry.level === 7) {
|
|
408
|
+
else if (entry.level === 7 ) {
|
|
393
409
|
yield entry;
|
|
394
410
|
}
|
|
395
411
|
}
|
|
396
412
|
}
|
|
397
413
|
}
|
|
398
414
|
async setFullSymbols(cancelToken) {
|
|
399
|
-
await this.
|
|
415
|
+
await this._outlineProviderReference?.object?.setFullSymbols(cancelToken);
|
|
400
416
|
}
|
|
401
417
|
get uri() {
|
|
402
|
-
return this.
|
|
418
|
+
return this._outlineProviderReference?.object?.uri;
|
|
403
419
|
}
|
|
404
420
|
get isEmpty() {
|
|
405
|
-
return this.
|
|
421
|
+
return this._outlineProviderReference?.object?.isEmpty ?? true;
|
|
406
422
|
}
|
|
407
423
|
async reveal(entry, options, sideBySide) {
|
|
408
424
|
await this._editorService.openEditor({
|
|
@@ -472,7 +488,7 @@ let NotebookCellOutline = NotebookCellOutline_1 = class NotebookCellOutline {
|
|
|
472
488
|
this._onDidChange.dispose();
|
|
473
489
|
this._dispoables.dispose();
|
|
474
490
|
this._entriesDisposables.dispose();
|
|
475
|
-
this.
|
|
491
|
+
this._outlineProviderReference?.dispose();
|
|
476
492
|
this._localDisposables.dispose();
|
|
477
493
|
}
|
|
478
494
|
};
|
|
@@ -499,7 +515,7 @@ let NotebookOutlineCreator = class NotebookOutlineCreator {
|
|
|
499
515
|
await outline.setFullSymbols(cancelToken);
|
|
500
516
|
}
|
|
501
517
|
else if (target === 1 && showAllOutlineSymbols) {
|
|
502
|
-
|
|
518
|
+
void outline.setFullSymbols(cancelToken);
|
|
503
519
|
}
|
|
504
520
|
return outline;
|
|
505
521
|
}
|
|
@@ -4,12 +4,15 @@ import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextK
|
|
|
4
4
|
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
6
6
|
import { registerAction2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
8
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
9
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
8
10
|
import { InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
9
11
|
import { CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_RESPONSE_TYPES, CTX_INLINE_CHAT_LAST_RESPONSE_TYPE, CTX_INLINE_CHAT_HAS_PROVIDER } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
10
12
|
import { CTX_NOTEBOOK_CELL_CHAT_FOCUSED, MENU_CELL_CHAT_INPUT, CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST, MENU_CELL_CHAT_WIDGET, CTX_NOTEBOOK_CHAT_USER_DID_EDIT, CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION, MENU_CELL_CHAT_WIDGET_STATUS, MENU_CELL_CHAT_WIDGET_FEEDBACK } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext';
|
|
11
13
|
import { NotebookChatController } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController';
|
|
12
14
|
import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL_TITLE_CELL_GROUP_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
15
|
+
import { insertNewCell } from '../insertCellActions.js';
|
|
13
16
|
import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
14
17
|
import { CellKind, NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
15
18
|
import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
@@ -35,7 +38,8 @@ registerAction2(class extends NotebookAction {
|
|
|
35
38
|
group: 'navigation',
|
|
36
39
|
order: 1,
|
|
37
40
|
when: ( (CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST.negate()))
|
|
38
|
-
}
|
|
41
|
+
},
|
|
42
|
+
f1: false
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
45
|
async runWithContext(accessor, context) {
|
|
@@ -57,7 +61,8 @@ registerAction2(class extends NotebookCellAction {
|
|
|
57
61
|
))),
|
|
58
62
|
weight: 0 + 7,
|
|
59
63
|
primary: 2048 | 16
|
|
60
|
-
}
|
|
64
|
+
},
|
|
65
|
+
f1: false
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
async runWithContext(accessor, context) {
|
|
@@ -91,7 +96,8 @@ registerAction2(class extends NotebookAction {
|
|
|
91
96
|
))),
|
|
92
97
|
weight: 0 + 7,
|
|
93
98
|
primary: 2048 | 18
|
|
94
|
-
}
|
|
99
|
+
},
|
|
100
|
+
f1: false
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
103
|
async runWithContext(accessor, context) {
|
|
@@ -117,7 +123,8 @@ registerAction2(class extends NotebookCellAction {
|
|
|
117
123
|
))),
|
|
118
124
|
weight: 0 + 7,
|
|
119
125
|
primary: 2048 | 16
|
|
120
|
-
}
|
|
126
|
+
},
|
|
127
|
+
f1: false
|
|
121
128
|
});
|
|
122
129
|
}
|
|
123
130
|
async runWithContext(accessor, context) {
|
|
@@ -144,7 +151,8 @@ registerAction2(class extends NotebookCellAction {
|
|
|
144
151
|
))),
|
|
145
152
|
weight: 0 + 7,
|
|
146
153
|
primary: 2048 | 18
|
|
147
|
-
}
|
|
154
|
+
},
|
|
155
|
+
f1: false
|
|
148
156
|
});
|
|
149
157
|
}
|
|
150
158
|
async runWithContext(accessor, context) {
|
|
@@ -163,7 +171,8 @@ registerAction2(class extends NotebookAction {
|
|
|
163
171
|
group: 'navigation',
|
|
164
172
|
order: 1,
|
|
165
173
|
when: CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST
|
|
166
|
-
}
|
|
174
|
+
},
|
|
175
|
+
f1: false
|
|
167
176
|
});
|
|
168
177
|
}
|
|
169
178
|
async runWithContext(accessor, context) {
|
|
@@ -180,7 +189,8 @@ registerAction2(class extends NotebookAction {
|
|
|
180
189
|
id: MENU_CELL_CHAT_WIDGET,
|
|
181
190
|
group: 'navigation',
|
|
182
191
|
order: 2
|
|
183
|
-
}
|
|
192
|
+
},
|
|
193
|
+
f1: false
|
|
184
194
|
});
|
|
185
195
|
}
|
|
186
196
|
async runWithContext(accessor, context) {
|
|
@@ -233,7 +243,8 @@ registerAction2(class extends NotebookAction {
|
|
|
233
243
|
order: 0,
|
|
234
244
|
when: ( (CTX_INLINE_CHAT_RESPONSE_TYPES.notEqualsTo("onlyMessages" ))),
|
|
235
245
|
}
|
|
236
|
-
]
|
|
246
|
+
],
|
|
247
|
+
f1: false
|
|
237
248
|
});
|
|
238
249
|
}
|
|
239
250
|
async runWithContext(accessor, context) {
|
|
@@ -260,7 +271,8 @@ registerAction2(class extends NotebookAction {
|
|
|
260
271
|
id: MENU_CELL_CHAT_WIDGET_STATUS,
|
|
261
272
|
group: 'main',
|
|
262
273
|
order: 1
|
|
263
|
-
}
|
|
274
|
+
},
|
|
275
|
+
f1: false
|
|
264
276
|
});
|
|
265
277
|
}
|
|
266
278
|
async runWithContext(accessor, context) {
|
|
@@ -278,7 +290,8 @@ registerAction2(class extends NotebookAction {
|
|
|
278
290
|
group: 'inline',
|
|
279
291
|
order: 1,
|
|
280
292
|
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
281
|
-
}
|
|
293
|
+
},
|
|
294
|
+
f1: false
|
|
282
295
|
});
|
|
283
296
|
}
|
|
284
297
|
async runWithContext(accessor, context) {
|
|
@@ -296,7 +309,8 @@ registerAction2(class extends NotebookAction {
|
|
|
296
309
|
group: 'inline',
|
|
297
310
|
order: 2,
|
|
298
311
|
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
299
|
-
}
|
|
312
|
+
},
|
|
313
|
+
f1: false
|
|
300
314
|
});
|
|
301
315
|
}
|
|
302
316
|
async runWithContext(accessor, context) {
|
|
@@ -314,13 +328,35 @@ registerAction2(class extends NotebookAction {
|
|
|
314
328
|
group: 'inline',
|
|
315
329
|
order: 3,
|
|
316
330
|
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
317
|
-
}
|
|
331
|
+
},
|
|
332
|
+
f1: false
|
|
318
333
|
});
|
|
319
334
|
}
|
|
320
335
|
async runWithContext(accessor, context) {
|
|
321
336
|
NotebookChatController.get(context.notebookEditor)?.feedbackLast(4 );
|
|
322
337
|
}
|
|
323
338
|
});
|
|
339
|
+
async function startChat(accessor, context, index, input, autoSend, source) {
|
|
340
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
341
|
+
const commandService = accessor.get(ICommandService);
|
|
342
|
+
if (configurationService.getValue(NotebookSetting.cellChat)) {
|
|
343
|
+
context.notebookEditor.focusContainer();
|
|
344
|
+
NotebookChatController.get(context.notebookEditor)?.run(index, input, autoSend);
|
|
345
|
+
}
|
|
346
|
+
else if (configurationService.getValue(NotebookSetting.cellGenerate)) {
|
|
347
|
+
const activeCell = context.notebookEditor.getActiveCell();
|
|
348
|
+
const targetCell = activeCell?.getTextLength() === 0 && source !== 'insertToolbar' ? activeCell : (await insertNewCell(accessor, context, CellKind.Code, 'below'));
|
|
349
|
+
if (targetCell) {
|
|
350
|
+
targetCell.enableAutoLanguageDetection();
|
|
351
|
+
await context.notebookEditor.revealFirstLineIfOutsideViewport(targetCell);
|
|
352
|
+
const codeEditor = context.notebookEditor.codeEditors.find(ce => ce[0] === targetCell)?.[1];
|
|
353
|
+
if (codeEditor) {
|
|
354
|
+
codeEditor.focus();
|
|
355
|
+
commandService.executeCommand('inlineChat.start');
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
324
360
|
registerAction2(class extends NotebookAction {
|
|
325
361
|
constructor() {
|
|
326
362
|
super({
|
|
@@ -360,7 +396,10 @@ registerAction2(class extends NotebookAction {
|
|
|
360
396
|
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
361
397
|
ContextKeyExpr.not(InputFocusedContextKey),
|
|
362
398
|
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
363
|
-
(ContextKeyExpr.
|
|
399
|
+
(ContextKeyExpr.or(
|
|
400
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
401
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
402
|
+
))
|
|
364
403
|
))),
|
|
365
404
|
weight: 200 ,
|
|
366
405
|
primary: 2048 | 39 ,
|
|
@@ -374,7 +413,10 @@ registerAction2(class extends NotebookAction {
|
|
|
374
413
|
when: ( (ContextKeyExpr.and(
|
|
375
414
|
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
376
415
|
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
377
|
-
(ContextKeyExpr.
|
|
416
|
+
(ContextKeyExpr.or(
|
|
417
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
418
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
419
|
+
))
|
|
378
420
|
)))
|
|
379
421
|
}
|
|
380
422
|
]
|
|
@@ -415,8 +457,7 @@ registerAction2(class extends NotebookAction {
|
|
|
415
457
|
}
|
|
416
458
|
async runWithContext(accessor, context) {
|
|
417
459
|
const index = Math.max(0, context.cell ? context.notebookEditor.getCellIndex(context.cell) + 1 : 0);
|
|
418
|
-
context.
|
|
419
|
-
NotebookChatController.get(context.notebookEditor)?.run(index, context.input, context.autoSend);
|
|
460
|
+
await startChat(accessor, context, index, context.input, context.autoSend, context.source);
|
|
420
461
|
}
|
|
421
462
|
});
|
|
422
463
|
registerAction2(class extends NotebookAction {
|
|
@@ -437,15 +478,17 @@ registerAction2(class extends NotebookAction {
|
|
|
437
478
|
when: ( (ContextKeyExpr.and(
|
|
438
479
|
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
439
480
|
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
440
|
-
(ContextKeyExpr.
|
|
481
|
+
(ContextKeyExpr.or(
|
|
482
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
483
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
484
|
+
))
|
|
441
485
|
)))
|
|
442
486
|
},
|
|
443
487
|
]
|
|
444
488
|
});
|
|
445
489
|
}
|
|
446
490
|
async runWithContext(accessor, context) {
|
|
447
|
-
context
|
|
448
|
-
NotebookChatController.get(context.notebookEditor)?.run(0, '', false);
|
|
491
|
+
await startChat(accessor, context, 0, '', false);
|
|
449
492
|
}
|
|
450
493
|
});
|
|
451
494
|
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
@@ -462,7 +505,10 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
|
462
505
|
(ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells')),
|
|
463
506
|
(ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden')),
|
|
464
507
|
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
465
|
-
(ContextKeyExpr.
|
|
508
|
+
(ContextKeyExpr.or(
|
|
509
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
510
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
511
|
+
))
|
|
466
512
|
)))
|
|
467
513
|
});
|
|
468
514
|
registerAction2(class extends NotebookAction {
|
|
@@ -490,6 +536,7 @@ registerAction2(class extends NotebookAction {
|
|
|
490
536
|
weight: 200
|
|
491
537
|
}
|
|
492
538
|
],
|
|
539
|
+
f1: false
|
|
493
540
|
});
|
|
494
541
|
}
|
|
495
542
|
async runWithContext(accessor, context) {
|
|
@@ -508,6 +555,7 @@ registerAction2(class extends NotebookAction {
|
|
|
508
555
|
weight: 200
|
|
509
556
|
}
|
|
510
557
|
],
|
|
558
|
+
f1: false
|
|
511
559
|
});
|
|
512
560
|
}
|
|
513
561
|
async runWithContext(accessor, context) {
|
|
@@ -526,6 +574,7 @@ registerAction2(class extends NotebookAction {
|
|
|
526
574
|
weight: 200
|
|
527
575
|
}
|
|
528
576
|
],
|
|
577
|
+
f1: false
|
|
529
578
|
});
|
|
530
579
|
}
|
|
531
580
|
async runWithContext(accessor, context) {
|
|
@@ -542,7 +591,8 @@ registerAction2(class extends NotebookAction {
|
|
|
542
591
|
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
543
592
|
weight: 0 + 10,
|
|
544
593
|
primary: 16 ,
|
|
545
|
-
}
|
|
594
|
+
},
|
|
595
|
+
f1: false
|
|
546
596
|
});
|
|
547
597
|
}
|
|
548
598
|
async runWithContext(accessor, context) {
|
|
@@ -559,7 +609,8 @@ registerAction2(class extends NotebookAction {
|
|
|
559
609
|
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
560
610
|
weight: 0 + 10,
|
|
561
611
|
primary: 18
|
|
562
|
-
}
|
|
612
|
+
},
|
|
613
|
+
f1: false
|
|
563
614
|
});
|
|
564
615
|
}
|
|
565
616
|
async runWithContext(accessor, context) {
|
|
@@ -582,7 +633,8 @@ registerAction2(class extends NotebookCellAction {
|
|
|
582
633
|
NOTEBOOK_CELL_GENERATED_BY_CHAT,
|
|
583
634
|
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true))
|
|
584
635
|
)))
|
|
585
|
-
}
|
|
636
|
+
},
|
|
637
|
+
f1: false
|
|
586
638
|
});
|
|
587
639
|
}
|
|
588
640
|
async runWithContext(accessor, context) {
|
|
@@ -35,6 +35,7 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
35
35
|
import { fixedDiffEditorOptions, fixedEditorOptions, fixedEditorPadding } from './diffCellEditorOptions.js';
|
|
36
36
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
37
37
|
import { DiffEditorWidget } from 'vscode/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
|
|
38
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
38
39
|
|
|
39
40
|
function getOptimizedNestedCodeEditorWidgetOptions() {
|
|
40
41
|
return {
|
|
@@ -50,7 +51,7 @@ function getOptimizedNestedCodeEditorWidgetOptions() {
|
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
let PropertyHeader = class PropertyHeader extends Disposable {
|
|
53
|
-
constructor(cell, propertyHeaderContainer, notebookEditor, accessor, contextMenuService, keybindingService, notificationService, menuService, contextKeyService, themeService, telemetryService, accessibilityService) {
|
|
54
|
+
constructor(cell, propertyHeaderContainer, notebookEditor, accessor, contextMenuService, keybindingService, commandService, notificationService, menuService, contextKeyService, themeService, telemetryService, accessibilityService) {
|
|
54
55
|
super();
|
|
55
56
|
this.cell = cell;
|
|
56
57
|
this.propertyHeaderContainer = propertyHeaderContainer;
|
|
@@ -58,6 +59,7 @@ let PropertyHeader = class PropertyHeader extends Disposable {
|
|
|
58
59
|
this.accessor = accessor;
|
|
59
60
|
this.contextMenuService = contextMenuService;
|
|
60
61
|
this.keybindingService = keybindingService;
|
|
62
|
+
this.commandService = commandService;
|
|
61
63
|
this.notificationService = notificationService;
|
|
62
64
|
this.menuService = menuService;
|
|
63
65
|
this.contextKeyService = contextKeyService;
|
|
@@ -104,7 +106,7 @@ let PropertyHeader = class PropertyHeader extends Disposable {
|
|
|
104
106
|
}
|
|
105
107
|
return undefined;
|
|
106
108
|
}
|
|
107
|
-
}, this.menuService, this.contextKeyService, this.contextMenuService, this.keybindingService, this.telemetryService));
|
|
109
|
+
}, this.menuService, this.contextKeyService, this.contextMenuService, this.keybindingService, this.commandService, this.telemetryService));
|
|
108
110
|
this._register(this._toolbar);
|
|
109
111
|
this._toolbar.context = {
|
|
110
112
|
cell: this.cell
|
|
@@ -188,12 +190,13 @@ let PropertyHeader = class PropertyHeader extends Disposable {
|
|
|
188
190
|
PropertyHeader = ( __decorate([
|
|
189
191
|
( __param(4, IContextMenuService)),
|
|
190
192
|
( __param(5, IKeybindingService)),
|
|
191
|
-
( __param(6,
|
|
192
|
-
( __param(7,
|
|
193
|
-
( __param(8,
|
|
194
|
-
( __param(9,
|
|
195
|
-
( __param(10,
|
|
196
|
-
( __param(11,
|
|
193
|
+
( __param(6, ICommandService)),
|
|
194
|
+
( __param(7, INotificationService)),
|
|
195
|
+
( __param(8, IMenuService)),
|
|
196
|
+
( __param(9, IContextKeyService)),
|
|
197
|
+
( __param(10, IThemeService)),
|
|
198
|
+
( __param(11, ITelemetryService)),
|
|
199
|
+
( __param(12, IAccessibilityService))
|
|
197
200
|
], PropertyHeader));
|
|
198
201
|
class AbstractElementRenderer extends Disposable {
|
|
199
202
|
constructor(notebookEditor, cell, templateData, style, instantiationService, languageService, modelService, textModelService, contextMenuService, keybindingService, notificationService, menuService, contextKeyService, configurationService) {
|
|
@@ -578,6 +581,7 @@ class SingleSideDiffElement extends AbstractElementRenderer {
|
|
|
578
581
|
super(notebookEditor, cell, templateData, style, instantiationService, languageService, modelService, textModelService, contextMenuService, keybindingService, notificationService, menuService, contextKeyService, configurationService);
|
|
579
582
|
this.cell = cell;
|
|
580
583
|
this.templateData = templateData;
|
|
584
|
+
this.updateBorders();
|
|
581
585
|
}
|
|
582
586
|
init() {
|
|
583
587
|
this._diagonalFill = this.templateData.diagonalFill;
|
|
@@ -961,6 +965,7 @@ let ModifiedElement = class ModifiedElement extends AbstractElementRenderer {
|
|
|
961
965
|
this.cell = cell;
|
|
962
966
|
this.templateData = templateData;
|
|
963
967
|
this._editorViewStateChanged = false;
|
|
968
|
+
this.updateBorders();
|
|
964
969
|
}
|
|
965
970
|
init() { }
|
|
966
971
|
styleContainer(container) {
|
|
@@ -40,6 +40,22 @@ import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/c
|
|
|
40
40
|
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
41
41
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
42
42
|
import './services/notebookRendererMessagingServiceImpl.js';
|
|
43
|
+
import 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
44
|
+
import 'vscode/vscode/vs/editor/contrib/documentSymbols/browser/outlineModel';
|
|
45
|
+
import 'vscode/vscode/vs/base/browser/dom';
|
|
46
|
+
import 'vscode/vscode/vs/base/browser/dompurify/dompurify';
|
|
47
|
+
import 'vscode/vscode/vs/base/browser/browser';
|
|
48
|
+
import 'vscode/vscode/vs/base/common/keyCodes';
|
|
49
|
+
import 'vscode/vscode/vs/base/common/platform';
|
|
50
|
+
import 'vscode/vscode/vs/base/common/themables';
|
|
51
|
+
import 'vscode/vscode/vs/base/common/filters';
|
|
52
|
+
import 'vscode/vscode/vs/base/common/strings';
|
|
53
|
+
import 'vscode/external/vscode-marked/lib/marked.esm.js';
|
|
54
|
+
import 'vscode/vscode/vs/base/common/codicons';
|
|
55
|
+
import 'vscode/vscode/vs/platform/markers/common/markers';
|
|
56
|
+
import 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
57
|
+
import 'vscode/vscode/vs/editor/common/languages';
|
|
58
|
+
import 'vscode/vscode/vs/base/common/async';
|
|
43
59
|
import 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
44
60
|
import './controller/insertCellActions.js';
|
|
45
61
|
import './controller/executeActions.js';
|
|
@@ -849,10 +865,20 @@ configurationRegistry.registerConfiguration({
|
|
|
849
865
|
default: true,
|
|
850
866
|
tags: ['notebookOutputLayout']
|
|
851
867
|
},
|
|
868
|
+
[NotebookSetting.minimalErrorRendering]: {
|
|
869
|
+
description: ( localizeWithPath(
|
|
870
|
+
_moduleId,
|
|
871
|
+
35,
|
|
872
|
+
"Control whether to render error output in a minimal style."
|
|
873
|
+
)),
|
|
874
|
+
type: 'boolean',
|
|
875
|
+
default: false,
|
|
876
|
+
tags: ['notebookOutputLayout']
|
|
877
|
+
},
|
|
852
878
|
[NotebookSetting.markupFontSize]: {
|
|
853
879
|
markdownDescription: ( localizeWithPath(
|
|
854
880
|
_moduleId,
|
|
855
|
-
|
|
881
|
+
36,
|
|
856
882
|
"Controls the font size in pixels of rendered markup in notebooks. When set to {0}, 120% of {1} is used.",
|
|
857
883
|
'`0`',
|
|
858
884
|
'`#editor.fontSize#`'
|
|
@@ -865,7 +891,7 @@ configurationRegistry.registerConfiguration({
|
|
|
865
891
|
[NotebookSetting.interactiveWindowCollapseCodeCells]: {
|
|
866
892
|
markdownDescription: ( localizeWithPath(
|
|
867
893
|
_moduleId,
|
|
868
|
-
|
|
894
|
+
37,
|
|
869
895
|
"Controls whether code cells in the interactive window are collapsed by default."
|
|
870
896
|
)),
|
|
871
897
|
type: 'string',
|
|
@@ -875,7 +901,7 @@ configurationRegistry.registerConfiguration({
|
|
|
875
901
|
[NotebookSetting.outputLineHeight]: {
|
|
876
902
|
markdownDescription: ( localizeWithPath(
|
|
877
903
|
_moduleId,
|
|
878
|
-
|
|
904
|
+
38,
|
|
879
905
|
"Line height of the output text within notebook cells.\n - When set to 0, editor line height is used.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values."
|
|
880
906
|
)),
|
|
881
907
|
type: 'number',
|
|
@@ -885,7 +911,7 @@ configurationRegistry.registerConfiguration({
|
|
|
885
911
|
[NotebookSetting.outputFontSize]: {
|
|
886
912
|
markdownDescription: ( localizeWithPath(
|
|
887
913
|
_moduleId,
|
|
888
|
-
|
|
914
|
+
39,
|
|
889
915
|
"Font size for the output text within notebook cells. When set to 0, {0} is used.",
|
|
890
916
|
'`#editor.fontSize#`'
|
|
891
917
|
)),
|
|
@@ -896,7 +922,7 @@ configurationRegistry.registerConfiguration({
|
|
|
896
922
|
[NotebookSetting.outputFontFamily]: {
|
|
897
923
|
markdownDescription: ( localizeWithPath(
|
|
898
924
|
_moduleId,
|
|
899
|
-
|
|
925
|
+
40,
|
|
900
926
|
"The font family of the output text within notebook cells. When set to empty, the {0} is used.",
|
|
901
927
|
'`#editor.fontFamily#`'
|
|
902
928
|
)),
|
|
@@ -906,7 +932,7 @@ configurationRegistry.registerConfiguration({
|
|
|
906
932
|
[NotebookSetting.outputScrolling]: {
|
|
907
933
|
markdownDescription: ( localizeWithPath(
|
|
908
934
|
_moduleId,
|
|
909
|
-
|
|
935
|
+
41,
|
|
910
936
|
"Initially render notebook outputs in a scrollable region when longer than the limit."
|
|
911
937
|
)),
|
|
912
938
|
type: 'boolean',
|
|
@@ -914,7 +940,7 @@ configurationRegistry.registerConfiguration({
|
|
|
914
940
|
default: typeof product$1.quality === 'string' && product$1.quality !== 'stable'
|
|
915
941
|
},
|
|
916
942
|
[NotebookSetting.outputWordWrap]: {
|
|
917
|
-
markdownDescription: ( localizeWithPath(_moduleId,
|
|
943
|
+
markdownDescription: ( localizeWithPath(_moduleId, 42, "Controls whether the lines in output should wrap.")),
|
|
918
944
|
type: 'boolean',
|
|
919
945
|
tags: ['notebookLayout', 'notebookOutputLayout'],
|
|
920
946
|
default: false
|
|
@@ -922,7 +948,7 @@ configurationRegistry.registerConfiguration({
|
|
|
922
948
|
[NotebookSetting.formatOnSave]: {
|
|
923
949
|
markdownDescription: ( localizeWithPath(
|
|
924
950
|
_moduleId,
|
|
925
|
-
|
|
951
|
+
43,
|
|
926
952
|
"Format a notebook on save. A formatter must be available, the file must not be saved after delay, and the editor must not be shutting down."
|
|
927
953
|
)),
|
|
928
954
|
type: 'boolean',
|
|
@@ -932,7 +958,7 @@ configurationRegistry.registerConfiguration({
|
|
|
932
958
|
[NotebookSetting.insertFinalNewline]: {
|
|
933
959
|
markdownDescription: ( localizeWithPath(
|
|
934
960
|
_moduleId,
|
|
935
|
-
|
|
961
|
+
44,
|
|
936
962
|
"When enabled, insert a final new line into the end of code cells when saving a notebook."
|
|
937
963
|
)),
|
|
938
964
|
type: 'boolean',
|
|
@@ -942,20 +968,20 @@ configurationRegistry.registerConfiguration({
|
|
|
942
968
|
[NotebookSetting.codeActionsOnSave]: {
|
|
943
969
|
markdownDescription: ( localizeWithPath(
|
|
944
970
|
_moduleId,
|
|
945
|
-
|
|
971
|
+
45,
|
|
946
972
|
'Run a series of Code Actions for a notebook on save. Code Actions must be specified, the file must not be saved after delay, and the editor must not be shutting down. Example: `"notebook.source.organizeImports": "explicit"`'
|
|
947
973
|
)),
|
|
948
974
|
type: 'object',
|
|
949
975
|
additionalProperties: {
|
|
950
976
|
type: ['string', 'boolean'],
|
|
951
977
|
enum: ['explicit', 'never', true, false],
|
|
952
|
-
enumDescriptions: [( localizeWithPath(_moduleId,
|
|
978
|
+
enumDescriptions: [( localizeWithPath(_moduleId, 46, 'Triggers Code Actions only when explicitly saved.')), ( localizeWithPath(_moduleId, 47, 'Never triggers Code Actions on save.')), ( localizeWithPath(
|
|
953
979
|
_moduleId,
|
|
954
|
-
|
|
980
|
+
48,
|
|
955
981
|
'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "explicit".'
|
|
956
982
|
)), ( localizeWithPath(
|
|
957
983
|
_moduleId,
|
|
958
|
-
|
|
984
|
+
49,
|
|
959
985
|
'Triggers Code Actions only when explicitly saved. This value will be deprecated in favor of "never".'
|
|
960
986
|
))],
|
|
961
987
|
},
|
|
@@ -964,7 +990,7 @@ configurationRegistry.registerConfiguration({
|
|
|
964
990
|
[NotebookSetting.formatOnCellExecution]: {
|
|
965
991
|
markdownDescription: ( localizeWithPath(
|
|
966
992
|
_moduleId,
|
|
967
|
-
|
|
993
|
+
50,
|
|
968
994
|
"Format a notebook cell upon execution. A formatter must be available."
|
|
969
995
|
)),
|
|
970
996
|
type: 'boolean',
|
|
@@ -973,7 +999,7 @@ configurationRegistry.registerConfiguration({
|
|
|
973
999
|
[NotebookSetting.confirmDeleteRunningCell]: {
|
|
974
1000
|
markdownDescription: ( localizeWithPath(
|
|
975
1001
|
_moduleId,
|
|
976
|
-
|
|
1002
|
+
51,
|
|
977
1003
|
"Control whether a confirmation prompt is required to delete a running cell."
|
|
978
1004
|
)),
|
|
979
1005
|
type: 'boolean',
|
|
@@ -982,7 +1008,7 @@ configurationRegistry.registerConfiguration({
|
|
|
982
1008
|
[NotebookSetting.findScope]: {
|
|
983
1009
|
markdownDescription: ( localizeWithPath(
|
|
984
1010
|
_moduleId,
|
|
985
|
-
|
|
1011
|
+
52,
|
|
986
1012
|
"Customize the Find Widget behavior for searching within notebook cells. When both markup source and markup preview are enabled, the Find Widget will search either the source code or preview based on the current state of the cell."
|
|
987
1013
|
)),
|
|
988
1014
|
type: 'object',
|
|
@@ -1015,7 +1041,7 @@ configurationRegistry.registerConfiguration({
|
|
|
1015
1041
|
[NotebookSetting.remoteSaving]: {
|
|
1016
1042
|
markdownDescription: ( localizeWithPath(
|
|
1017
1043
|
_moduleId,
|
|
1018
|
-
|
|
1044
|
+
53,
|
|
1019
1045
|
"Enables the incremental saving of notebooks in Remote environment. When enabled, only the changes to the notebook are sent to the extension host, improving performance for large notebooks and slow network connections."
|
|
1020
1046
|
)),
|
|
1021
1047
|
type: 'boolean',
|
|
@@ -1024,59 +1050,57 @@ configurationRegistry.registerConfiguration({
|
|
|
1024
1050
|
[NotebookSetting.scrollToRevealCell]: {
|
|
1025
1051
|
markdownDescription: ( localizeWithPath(
|
|
1026
1052
|
_moduleId,
|
|
1027
|
-
|
|
1053
|
+
54,
|
|
1028
1054
|
"How far to scroll when revealing the next cell upon running {0}.",
|
|
1029
1055
|
'notebook.cell.executeAndSelectBelow'
|
|
1030
1056
|
)),
|
|
1031
1057
|
type: 'string',
|
|
1032
1058
|
enum: ['fullCell', 'firstLine', 'none'],
|
|
1033
1059
|
markdownEnumDescriptions: [
|
|
1034
|
-
( localizeWithPath(_moduleId,
|
|
1035
|
-
( localizeWithPath(_moduleId,
|
|
1036
|
-
( localizeWithPath(_moduleId,
|
|
1060
|
+
( localizeWithPath(_moduleId, 55, 'Scroll to fully reveal the next cell.')),
|
|
1061
|
+
( localizeWithPath(_moduleId, 56, 'Scroll to reveal the first line of the next cell.')),
|
|
1062
|
+
( localizeWithPath(_moduleId, 57, 'Do not scroll.')),
|
|
1037
1063
|
],
|
|
1038
1064
|
default: 'fullCell'
|
|
1039
1065
|
},
|
|
1040
|
-
[NotebookSetting.
|
|
1066
|
+
[NotebookSetting.cellChat]: {
|
|
1067
|
+
markdownDescription: ( localizeWithPath(_moduleId, 58, "Enable experimental floating chat widget in notebooks.")),
|
|
1068
|
+
type: 'boolean',
|
|
1069
|
+
default: false
|
|
1070
|
+
},
|
|
1071
|
+
[NotebookSetting.cellGenerate]: {
|
|
1041
1072
|
markdownDescription: ( localizeWithPath(
|
|
1042
1073
|
_moduleId,
|
|
1043
|
-
|
|
1044
|
-
"
|
|
1074
|
+
59,
|
|
1075
|
+
"Enable experimental generate action to create code cell with inline chat enabled."
|
|
1045
1076
|
)),
|
|
1046
|
-
type: 'string',
|
|
1047
|
-
enum: ['auto', 'on', 'off'],
|
|
1048
|
-
markdownEnumDescriptions: [
|
|
1049
|
-
( localizeWithPath(
|
|
1050
|
-
_moduleId,
|
|
1051
|
-
58,
|
|
1052
|
-
"Anchor the viewport to the focused cell depending on context unless {0} is set to {1}.",
|
|
1053
|
-
'notebook.scrolling.revealCellBehavior',
|
|
1054
|
-
'none'
|
|
1055
|
-
)),
|
|
1056
|
-
( localizeWithPath(_moduleId, 59, "Always anchor the viewport to the focused cell.")),
|
|
1057
|
-
( localizeWithPath(_moduleId, 60, "The focused cell may shift around as cells resize."))
|
|
1058
|
-
],
|
|
1059
|
-
default: 'auto'
|
|
1060
|
-
},
|
|
1061
|
-
[NotebookSetting.cellChat]: {
|
|
1062
|
-
markdownDescription: ( localizeWithPath(_moduleId, 61, "Enable experimental floating chat widget in notebooks.")),
|
|
1063
1077
|
type: 'boolean',
|
|
1064
|
-
default:
|
|
1078
|
+
default: typeof product$1.quality === 'string' && product$1.quality !== 'stable',
|
|
1079
|
+
tags: ['experimental']
|
|
1065
1080
|
},
|
|
1066
1081
|
[NotebookSetting.notebookVariablesView]: {
|
|
1067
1082
|
markdownDescription: ( localizeWithPath(
|
|
1068
1083
|
_moduleId,
|
|
1069
|
-
|
|
1084
|
+
60,
|
|
1070
1085
|
"Enable the experimental notebook variables view within the debug panel."
|
|
1071
1086
|
)),
|
|
1072
1087
|
type: 'boolean',
|
|
1073
1088
|
default: false
|
|
1074
1089
|
},
|
|
1075
1090
|
[NotebookSetting.cellFailureDiagnostics]: {
|
|
1076
|
-
markdownDescription: ( localizeWithPath(_moduleId,
|
|
1091
|
+
markdownDescription: ( localizeWithPath(_moduleId, 61, "Show available diagnostics for cell failures.")),
|
|
1077
1092
|
type: 'boolean',
|
|
1078
1093
|
default: true
|
|
1079
1094
|
},
|
|
1095
|
+
[NotebookSetting.outputBackupSizeLimit]: {
|
|
1096
|
+
markdownDescription: ( localizeWithPath(
|
|
1097
|
+
_moduleId,
|
|
1098
|
+
62,
|
|
1099
|
+
"The limit of notebook output size in kilobytes (KB) where notebook files will no longer be backed up for hot reload. Use 0 for unlimited."
|
|
1100
|
+
)),
|
|
1101
|
+
type: 'number',
|
|
1102
|
+
default: 10000
|
|
1103
|
+
}
|
|
1080
1104
|
}
|
|
1081
1105
|
});
|
|
1082
1106
|
|
|
@@ -14,6 +14,7 @@ import { isEqual } from 'vscode/vscode/vs/base/common/resources';
|
|
|
14
14
|
import { ILanguageService } from 'vscode/vscode/vs/editor/common/languages/language';
|
|
15
15
|
import { TextModel } from 'vscode/vscode/vs/editor/common/model/textModel';
|
|
16
16
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
17
|
+
import { ILanguageDetectionService } from 'vscode/vscode/vs/workbench/services/languageDetection/common/languageDetectionWorkerService.service';
|
|
17
18
|
|
|
18
19
|
var NotebookTextModel_1;
|
|
19
20
|
class StackOperation {
|
|
@@ -141,13 +142,14 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
141
142
|
get alternativeVersionId() {
|
|
142
143
|
return this._alternativeVersionId;
|
|
143
144
|
}
|
|
144
|
-
constructor(viewType, uri, cells, metadata, options, _undoService, _modelService, _languageService) {
|
|
145
|
+
constructor(viewType, uri, cells, metadata, options, _undoService, _modelService, _languageService, _languageDetectionService) {
|
|
145
146
|
super();
|
|
146
147
|
this.viewType = viewType;
|
|
147
148
|
this.uri = uri;
|
|
148
149
|
this._undoService = _undoService;
|
|
149
150
|
this._modelService = _modelService;
|
|
150
151
|
this._languageService = _languageService;
|
|
152
|
+
this._languageDetectionService = _languageDetectionService;
|
|
151
153
|
this._isDisposed = false;
|
|
152
154
|
this._onWillDispose = this._register(( new Emitter()));
|
|
153
155
|
this._onWillAddRemoveCells = this._register(( new Emitter()));
|
|
@@ -235,7 +237,8 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
235
237
|
cell.internalMetadata,
|
|
236
238
|
collapseState,
|
|
237
239
|
this.transientOptions,
|
|
238
|
-
this._languageService
|
|
240
|
+
this._languageService,
|
|
241
|
+
this._languageDetectionService
|
|
239
242
|
));
|
|
240
243
|
}));
|
|
241
244
|
for (let i = 0; i < mainCells.length; i++) {
|
|
@@ -608,7 +611,8 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
608
611
|
cellDto.internalMetadata,
|
|
609
612
|
collapseState,
|
|
610
613
|
this.transientOptions,
|
|
611
|
-
this._languageService
|
|
614
|
+
this._languageService,
|
|
615
|
+
this._languageDetectionService
|
|
612
616
|
));
|
|
613
617
|
const textModel = this._modelService.getModel(cellUri);
|
|
614
618
|
if (textModel && textModel instanceof TextModel) {
|
|
@@ -983,7 +987,8 @@ let NotebookTextModel = NotebookTextModel_1 = class NotebookTextModel extends Di
|
|
|
983
987
|
NotebookTextModel = NotebookTextModel_1 = ( __decorate([
|
|
984
988
|
( __param(5, IUndoRedoService)),
|
|
985
989
|
( __param(6, IModelService)),
|
|
986
|
-
( __param(7, ILanguageService))
|
|
990
|
+
( __param(7, ILanguageService)),
|
|
991
|
+
( __param(8, ILanguageDetectionService))
|
|
987
992
|
], NotebookTextModel));
|
|
988
993
|
class OutputSequence {
|
|
989
994
|
constructor(outputs) {
|
|
@@ -210,7 +210,7 @@ let FileWorkingCopyManager = class FileWorkingCopyManager extends Disposable {
|
|
|
210
210
|
let sourceContents;
|
|
211
211
|
const sourceWorkingCopy = this.get(source);
|
|
212
212
|
if (sourceWorkingCopy?.isResolved()) {
|
|
213
|
-
sourceContents = await sourceWorkingCopy.model.snapshot(CancellationToken.None);
|
|
213
|
+
sourceContents = await sourceWorkingCopy.model.snapshot(1 , CancellationToken.None);
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
216
|
sourceContents = (await this.fileService.readFileStream(source)).value;
|
|
@@ -162,7 +162,7 @@ let StoredFileWorkingCopyManager = class StoredFileWorkingCopyManager extends Ba
|
|
|
162
162
|
workingCopiesToRestore.push({
|
|
163
163
|
source: sourceResource,
|
|
164
164
|
target: targetResource,
|
|
165
|
-
snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(CancellationToken.None) : undefined
|
|
165
|
+
snapshot: sourceWorkingCopy.isDirty() ? await sourceWorkingCopy.model?.snapshot(1 , CancellationToken.None) : undefined
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
}
|
|
@@ -105,7 +105,7 @@ let UntitledFileWorkingCopy = class UntitledFileWorkingCopy extends Disposable {
|
|
|
105
105
|
async backup(token) {
|
|
106
106
|
let content = undefined;
|
|
107
107
|
if (this.isResolved()) {
|
|
108
|
-
content = await raceCancellation(this.model.snapshot(token), token);
|
|
108
|
+
content = await raceCancellation(this.model.snapshot(2 , token), token);
|
|
109
109
|
}
|
|
110
110
|
else if (this.initialContents) {
|
|
111
111
|
content = this.initialContents.value;
|