@codingame/monaco-vscode-interactive-service-override 11.1.1 → 12.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +16 -1
  3. package/package.json +30 -9
  4. package/vscode/src/vs/workbench/contrib/interactive/browser/interactive.contribution.d.ts +20 -0
  5. package/vscode/src/vs/workbench/contrib/interactive/browser/interactive.contribution.js +106 -124
  6. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
  7. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +4 -3
  8. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.d.ts +20 -0
  9. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js +1 -0
  10. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditor.css.js +1 -1
  11. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditor.d.ts +101 -0
  12. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditor.js +29 -27
  13. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.d.ts +17 -0
  14. package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js +1 -0
  15. package/vscode/src/vs/workbench/contrib/interactive/browser/media/interactive.css.js +1 -1
  16. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +19 -0
  17. package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +26 -21
  18. package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css.js +1 -1
  19. package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css.js +1 -1
  20. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
  21. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +13 -8
  22. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +38 -0
  23. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +28 -26
  24. package/interactive.js +0 -15
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export { default } from 'vscode/service-override/interactive';
1
+ import type { IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ export default function getServiceOverride(): IEditorOverrideServices;
package/index.js CHANGED
@@ -1 +1,16 @@
1
- export { default } from './interactive.js';
1
+
2
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
3
+ import { InteractiveHistoryService } from './vscode/src/vs/workbench/contrib/interactive/browser/interactiveHistoryService.js';
4
+ import { IInteractiveHistoryService } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.service';
5
+ import { InteractiveDocumentService } from './vscode/src/vs/workbench/contrib/interactive/browser/interactiveDocumentService.js';
6
+ import { IInteractiveDocumentService } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveDocumentService.service';
7
+ import './vscode/src/vs/workbench/contrib/interactive/browser/interactive.contribution.js';
8
+
9
+ function getServiceOverride() {
10
+ return {
11
+ [IInteractiveHistoryService.toString()]: new SyncDescriptor(InteractiveHistoryService, [], true),
12
+ [IInteractiveDocumentService.toString()]: new SyncDescriptor(InteractiveDocumentService, [], true)
13
+ };
14
+ }
15
+
16
+ export { getServiceOverride as default };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-interactive-service-override",
3
- "version": "11.1.1",
3
+ "version": "12.0.0",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - interactive service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,27 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - interactive service-override",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-1ae7d696-d960-5ac6-97a3-9fe7c8c3a793-common": "12.0.0",
19
+ "@codingame/monaco-vscode-22790577-4553-50b6-978d-0acc75c394cc-common": "12.0.0",
20
+ "@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common": "12.0.0",
21
+ "@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common": "12.0.0",
22
+ "@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common": "12.0.0",
23
+ "@codingame/monaco-vscode-b4efa70b-52b9-5670-ab5c-f10b10b6834e-common": "12.0.0",
24
+ "@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common": "12.0.0",
25
+ "@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common": "12.0.0",
26
+ "@codingame/monaco-vscode-eba0b9b3-174c-5dae-9867-a37810ca1808-common": "12.0.0",
27
+ "@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common": "12.0.0",
28
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.0"
29
+ },
30
+ "peerDependencies": {
31
+ "@codingame/monaco-vscode-notebook-service-override": "12.0.0"
32
+ },
33
+ "peerDependenciesMeta": {
34
+ "@codingame/monaco-vscode-notebook-service-override": {
35
+ "optional": true
36
+ }
37
+ },
17
38
  "main": "index.js",
18
39
  "module": "index.js",
19
40
  "types": "index.d.ts",
@@ -22,12 +43,12 @@
22
43
  "default": "./index.js"
23
44
  },
24
45
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
46
+ "default": "./vscode/src/*.js",
47
+ "types": "./vscode/src/*.d.ts"
48
+ },
49
+ "./*": {
50
+ "default": "./*.js",
51
+ "types": "./*.d.ts"
26
52
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.1",
30
- "@codingame/monaco-vscode-chat-interactive-notebook-search-common": "11.1.1",
31
- "@codingame/monaco-vscode-chat-interactive-notebook-search-terminal-common": "11.1.1"
32
53
  }
33
54
  }
@@ -0,0 +1,20 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IInstantiationService } from "vscode/vscode/vs/platform/instantiation/common/instantiation";
3
+ import { IWorkbenchContribution } from "vscode/vscode/vs/workbench/common/contributions";
4
+ import { IEditorSerializer } from "vscode/vscode/vs/workbench/common/editor";
5
+ import { EditorInput } from "vscode/vscode/vs/workbench/common/editor/editorInput";
6
+ import { InteractiveEditorInput } from "@codingame/monaco-vscode-eba0b9b3-174c-5dae-9867-a37810ca1808-common/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput";
7
+ import { INotebookService } from "vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service";
8
+ import { IEditorResolverService } from "vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service";
9
+ import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
10
+ export declare class InteractiveDocumentContribution extends Disposable implements IWorkbenchContribution {
11
+ private readonly instantiationService;
12
+ static readonly ID = "workbench.contrib.interactiveDocument";
13
+ constructor(notebookService: INotebookService, editorResolverService: IEditorResolverService, editorService: IEditorService, instantiationService: IInstantiationService);
14
+ }
15
+ export declare class InteractiveEditorSerializer implements IEditorSerializer {
16
+ static readonly ID: string;
17
+ canSerialize(editor: EditorInput): editor is InteractiveEditorInput;
18
+ serialize(input: EditorInput): string | undefined;
19
+ deserialize(instantiationService: IInstantiationService, raw: string): InteractiveEditorInput | undefined;
20
+ }
@@ -1,5 +1,7 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Iterable } from 'vscode/vscode/vs/base/common/iterator';
4
+ import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
3
5
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
6
  import { parse } from 'vscode/vscode/vs/base/common/marshalling';
5
7
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
@@ -20,7 +22,9 @@ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/confi
20
22
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
21
23
  import { EditorActivation } from 'vscode/vscode/vs/platform/editor/common/editor';
22
24
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
25
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
23
26
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
27
+ import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
24
28
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
25
29
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
26
30
  import { registerColor, ifDefinedThenElse } from 'vscode/vscode/vs/platform/theme/common/colorUtils';
@@ -34,26 +38,26 @@ import 'vscode/vscode/vs/platform/theme/common/colors/minimapColors';
34
38
  import 'vscode/vscode/vs/platform/theme/common/colors/miscColors';
35
39
  import 'vscode/vscode/vs/platform/theme/common/colors/quickpickColors';
36
40
  import 'vscode/vscode/vs/platform/theme/common/colors/searchColors';
37
- import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
38
- import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
39
- import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
41
+ import { EditorPaneDescriptor } from '@codingame/monaco-vscode-9e888134-1a6f-58d9-b0e6-0fc047448366-common/vscode/vs/workbench/browser/editor';
42
+ import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
43
+ import { EditorExtensions, EditorsOrder } from 'vscode/vscode/vs/workbench/common/editor';
40
44
  import { PANEL_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
41
- import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
42
- import { INTERACTIVE_INPUT_CURSOR_BOUNDARY, InteractiveWindowSetting } from './interactiveCommon.js';
45
+ import { ResourceNotebookCellEdit } from '@codingame/monaco-vscode-271a23cd-c7d7-5761-ae35-a923a42987b8-common/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
46
+ import { INTERACTIVE_INPUT_CURSOR_BOUNDARY, ReplEditorSettings } from './interactiveCommon.js';
43
47
  import 'vscode/vscode/vs/base/common/event';
44
48
  import { InteractiveEditor } from './interactiveEditor.js';
45
- import { InteractiveEditorInput } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput';
49
+ import { InteractiveEditorInput } from '@codingame/monaco-vscode-eba0b9b3-174c-5dae-9867-a37810ca1808-common/vscode/vs/workbench/contrib/interactive/browser/interactiveEditorInput';
46
50
  import 'vscode/vscode/vs/base/common/collections';
47
51
  import 'vscode/vscode/vs/base/common/map';
48
52
  import { IInteractiveHistoryService } from 'vscode/vscode/vs/workbench/contrib/interactive/browser/interactiveHistoryService.service';
49
- import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
50
- import { executeIcon } from '@codingame/monaco-vscode-chat-interactive-notebook-search-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
53
+ import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
54
+ import { executeIcon } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
51
55
  import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
52
- import { INTERACTIVE_WINDOW_EDITOR_ID, CellUri, NotebookWorkingCopyTypeIdentifier, CellKind, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
53
- import { IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED, InteractiveWindowOpen } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
56
+ import { INTERACTIVE_WINDOW_EDITOR_ID, CellUri, NotebookWorkingCopyTypeIdentifier, CellEditType, CellKind, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
57
+ import { IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED, InteractiveWindowOpen } from '@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
54
58
  import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
55
59
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
56
- import { columnToEditorGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupColumn';
60
+ import { columnToEditorGroup } from '@codingame/monaco-vscode-f48982c4-9e82-55e2-b800-20e6d1e6096f-common/vscode/vs/workbench/services/editor/common/editorGroupColumn';
57
61
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
58
62
  import { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
59
63
  import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService.service';
@@ -61,12 +65,12 @@ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/commo
61
65
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
62
66
  import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService.service';
63
67
  import { isReplEditorControl } from '../../replNotebook/browser/replEditor.js';
64
- import { InlineChatController } from '@codingame/monaco-vscode-chat-interactive-notebook-search-terminal-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
68
+ import { InlineChatController } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
65
69
  import { IsWindowsContext, IsLinuxContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
66
70
 
67
- const interactiveWindowCategory = ( localize2(1891, "Interactive Window"));
68
- ( (Registry.as(EditorExtensions.EditorPane))).registerEditorPane(EditorPaneDescriptor.create(InteractiveEditor, INTERACTIVE_WINDOW_EDITOR_ID, 'Interactive Window'), [
69
- ( (new SyncDescriptor(InteractiveEditorInput)))
71
+ const interactiveWindowCategory = ( localize2(6824, "Interactive Window"));
72
+ ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(InteractiveEditor, INTERACTIVE_WINDOW_EDITOR_ID, 'Interactive Window'), [
73
+ ( new SyncDescriptor(InteractiveEditorInput))
70
74
  ]);
71
75
  let InteractiveDocumentContribution = class InteractiveDocumentContribution extends Disposable {
72
76
  static { this.ID = 'workbench.contrib.interactiveDocument'; }
@@ -91,7 +95,7 @@ let InteractiveDocumentContribution = class InteractiveDocumentContribution exte
91
95
  singlePerResource: true
92
96
  }, {
93
97
  createEditorInput: ({ resource }) => {
94
- const editorInput = editorService.getEditors(1 ).find(editor => editor.editor instanceof InteractiveEditorInput && ( (editor.editor.inputResource.toString())) === ( (resource.toString())));
98
+ const editorInput = editorService.getEditors(EditorsOrder.SEQUENTIAL).find(editor => editor.editor instanceof InteractiveEditorInput && ( editor.editor.inputResource.toString()) === ( resource.toString()));
95
99
  return editorInput;
96
100
  }
97
101
  });
@@ -129,7 +133,7 @@ let InteractiveDocumentContribution = class InteractiveDocumentContribution exte
129
133
  },
130
134
  createUntitledEditorInput: ({ resource, options }) => {
131
135
  if (!resource) {
132
- throw ( (new Error('Interactive window editors must have a resource name')));
136
+ throw ( new Error('Interactive window editors must have a resource name'));
133
137
  }
134
138
  const data = CellUri.parse(resource);
135
139
  let cellOptions;
@@ -154,12 +158,12 @@ let InteractiveDocumentContribution = class InteractiveDocumentContribution exte
154
158
  });
155
159
  }
156
160
  };
157
- InteractiveDocumentContribution = ( (__decorate([
158
- ( (__param(0, INotebookService))),
159
- ( (__param(1, IEditorResolverService))),
160
- ( (__param(2, IEditorService))),
161
- ( (__param(3, IInstantiationService)))
162
- ], InteractiveDocumentContribution)));
161
+ InteractiveDocumentContribution = ( __decorate([
162
+ ( __param(0, INotebookService)),
163
+ ( __param(1, IEditorResolverService)),
164
+ ( __param(2, IEditorService)),
165
+ ( __param(3, IInstantiationService))
166
+ ], InteractiveDocumentContribution));
163
167
  let InteractiveInputContentProvider = class InteractiveInputContentProvider {
164
168
  static { this.ID = 'workbench.contrib.interactiveInputContentProvider'; }
165
169
  constructor(textModelService, _modelService) {
@@ -178,14 +182,14 @@ let InteractiveInputContentProvider = class InteractiveInputContentProvider {
178
182
  return result;
179
183
  }
180
184
  };
181
- InteractiveInputContentProvider = ( (__decorate([
182
- ( (__param(0, ITextModelService))),
183
- ( (__param(1, IModelService)))
184
- ], InteractiveInputContentProvider)));
185
+ InteractiveInputContentProvider = ( __decorate([
186
+ ( __param(0, ITextModelService)),
187
+ ( __param(1, IModelService))
188
+ ], InteractiveInputContentProvider));
185
189
  function createEditor(resource, instantiationService) {
186
190
  const counter = /\/Interactive-(\d+)/.exec(resource.path);
187
191
  const inputBoxPath = counter && counter[1] ? `/InteractiveInput-${counter[1]}` : 'InteractiveInput';
188
- const inputUri = ( (URI.from({ scheme: Schemas.vscodeInteractiveInput, path: inputBoxPath })));
192
+ const inputUri = ( URI.from({ scheme: Schemas.vscodeInteractiveInput, path: inputBoxPath }));
189
193
  const editorInput = InteractiveEditorInput.create(instantiationService, resource, inputUri);
190
194
  return editorInput;
191
195
  }
@@ -219,12 +223,12 @@ let InteractiveWindowWorkingCopyEditorHandler = class InteractiveWindowWorkingCo
219
223
  return NotebookWorkingCopyTypeIdentifier.parse(workingCopy.typeId)?.viewType;
220
224
  }
221
225
  };
222
- InteractiveWindowWorkingCopyEditorHandler = ( (__decorate([
223
- ( (__param(0, IInstantiationService))),
224
- ( (__param(1, IWorkingCopyEditorService))),
225
- ( (__param(2, IExtensionService)))
226
- ], InteractiveWindowWorkingCopyEditorHandler)));
227
- registerWorkbenchContribution2(InteractiveDocumentContribution.ID, InteractiveDocumentContribution, 2 );
226
+ InteractiveWindowWorkingCopyEditorHandler = ( __decorate([
227
+ ( __param(0, IInstantiationService)),
228
+ ( __param(1, IWorkingCopyEditorService)),
229
+ ( __param(2, IExtensionService))
230
+ ], InteractiveWindowWorkingCopyEditorHandler));
231
+ registerWorkbenchContribution2(InteractiveDocumentContribution.ID, InteractiveDocumentContribution, WorkbenchPhase.BlockRestore);
228
232
  registerWorkbenchContribution2(InteractiveInputContentProvider.ID, InteractiveInputContentProvider, {
229
233
  editorTypeId: INTERACTIVE_WINDOW_EDITOR_ID
230
234
  });
@@ -263,17 +267,17 @@ class InteractiveEditorSerializer {
263
267
  return input;
264
268
  }
265
269
  }
266
- ( (Registry.as(EditorExtensions.EditorFactory)))
270
+ ( Registry.as(EditorExtensions.EditorFactory))
267
271
  .registerEditorSerializer(InteractiveEditorSerializer.ID, InteractiveEditorSerializer);
268
272
  registerAction2(class extends Action2 {
269
273
  constructor() {
270
274
  super({
271
275
  id: '_interactive.open',
272
- title: ( localize2(1892, 'Open Interactive Window')),
276
+ title: ( localize2(6825, 'Open Interactive Window')),
273
277
  f1: false,
274
278
  category: interactiveWindowCategory,
275
279
  metadata: {
276
- description: ( localize(1892, 'Open Interactive Window')),
280
+ description: ( localize(6825, 'Open Interactive Window')),
277
281
  args: [
278
282
  {
279
283
  name: 'showOptions',
@@ -324,11 +328,11 @@ registerAction2(class extends Action2 {
324
328
  preserveFocus: typeof showOptions !== 'number' ? (showOptions?.preserveFocus ?? false) : false
325
329
  };
326
330
  if (resource && extname(resource) === '.interactive') {
327
- logService.debug('Open interactive window from resource:', ( (resource.toString())));
331
+ logService.debug('Open interactive window from resource:', ( resource.toString()));
328
332
  const resourceUri = URI.revive(resource);
329
- const editors = editorService.findEditors(resourceUri).filter(id => id.editor instanceof InteractiveEditorInput && id.editor.resource?.toString() === ( (resourceUri.toString())));
333
+ const editors = editorService.findEditors(resourceUri).filter(id => id.editor instanceof InteractiveEditorInput && id.editor.resource?.toString() === ( resourceUri.toString()));
330
334
  if (editors.length) {
331
- logService.debug('Find existing interactive window:', ( (resource.toString())));
335
+ logService.debug('Find existing interactive window:', ( resource.toString()));
332
336
  const editorInput = editors[0].editor;
333
337
  const currentGroup = editors[0].groupId;
334
338
  const editor = await editorService.openEditor(editorInput, editorOptions, currentGroup);
@@ -340,24 +344,24 @@ registerAction2(class extends Action2 {
340
344
  };
341
345
  }
342
346
  }
343
- const existingNotebookDocument = ( (new Set()));
344
- editorService.getEditors(1 ).forEach(editor => {
347
+ const existingNotebookDocument = ( new Set());
348
+ editorService.getEditors(EditorsOrder.SEQUENTIAL).forEach(editor => {
345
349
  if (editor.editor.resource) {
346
- existingNotebookDocument.add(( (editor.editor.resource.toString())));
350
+ existingNotebookDocument.add(( editor.editor.resource.toString()));
347
351
  }
348
352
  });
349
353
  let notebookUri = undefined;
350
354
  let inputUri = undefined;
351
355
  let counter = 1;
352
356
  do {
353
- notebookUri = ( (URI.from({ scheme: Schemas.untitled, path: `/Interactive-${counter}.interactive` })));
354
- inputUri = ( (URI.from(
357
+ notebookUri = ( URI.from({ scheme: Schemas.untitled, path: `/Interactive-${counter}.interactive` }));
358
+ inputUri = ( URI.from(
355
359
  { scheme: Schemas.vscodeInteractiveInput, path: `/InteractiveInput-${counter}` }
356
- )));
360
+ ));
357
361
  counter++;
358
- } while (( (existingNotebookDocument.has( (notebookUri.toString())))));
362
+ } while (( existingNotebookDocument.has(( notebookUri.toString()))));
359
363
  InteractiveEditorInput.setName(notebookUri, title);
360
- logService.debug('Open new interactive window:', ( (notebookUri.toString())), ( (inputUri.toString())));
364
+ logService.debug('Open new interactive window:', ( notebookUri.toString()), ( inputUri.toString()));
361
365
  if (id) {
362
366
  const allKernels = kernelService.getMatchingKernel({ uri: notebookUri, notebookType: 'interactive' }).all;
363
367
  const preferredKernel = allKernels.find(kernel => kernel.id === id);
@@ -377,25 +381,19 @@ registerAction2(class extends Action2 {
377
381
  constructor() {
378
382
  super({
379
383
  id: 'interactive.execute',
380
- title: ( localize2(1893, 'Execute Code')),
384
+ title: ( localize2(6826, 'Execute Code')),
381
385
  category: interactiveWindowCategory,
382
386
  keybinding: [{
383
- when: ( (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'))),
384
- primary: 2048 | 3 ,
387
+ when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')))),
388
+ primary: KeyMod.CtrlCmd | KeyCode.Enter,
385
389
  weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
386
390
  }, {
387
- when: ( (ContextKeyExpr.and(
388
- (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')),
389
- (ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', true))
390
- ))),
391
- primary: 1024 | 3 ,
391
+ when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')), ( ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', true)))),
392
+ primary: KeyMod.Shift | KeyCode.Enter,
392
393
  weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
393
394
  }, {
394
- when: ( (ContextKeyExpr.and(
395
- (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')),
396
- (ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', false))
397
- ))),
398
- primary: 3 ,
395
+ when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')), ( ContextKeyExpr.equals('config.interactiveWindow.executeWithShiftEnter', false)))),
396
+ primary: KeyCode.Enter,
399
397
  weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
400
398
  }],
401
399
  menu: [
@@ -462,8 +460,8 @@ registerAction2(class extends Action2 {
462
460
  } :
463
461
  undefined;
464
462
  await bulkEditService.apply([
465
- ( (new ResourceNotebookCellEdit(notebookDocument.uri, {
466
- editType: 1 ,
463
+ ( new ResourceNotebookCellEdit(notebookDocument.uri, {
464
+ editType: CellEditType.Replace,
467
465
  index: index,
468
466
  count: 0,
469
467
  cells: [{
@@ -475,7 +473,7 @@ registerAction2(class extends Action2 {
475
473
  metadata: {},
476
474
  collapseState
477
475
  }]
478
- })))
476
+ }))
479
477
  ]);
480
478
  const range = { start: index, end: index + 1 };
481
479
  editorControl.notebookEditor.revealCellRangeInView(range);
@@ -493,7 +491,7 @@ registerAction2(class extends Action2 {
493
491
  constructor() {
494
492
  super({
495
493
  id: 'interactive.input.clear',
496
- title: ( localize2(1894, 'Clear the interactive window input editor contents')),
494
+ title: ( localize2(6827, 'Clear the interactive window input editor contents')),
497
495
  category: interactiveWindowCategory,
498
496
  f1: false
499
497
  });
@@ -515,19 +513,15 @@ registerAction2(class extends Action2 {
515
513
  constructor() {
516
514
  super({
517
515
  id: 'interactive.history.previous',
518
- title: ( localize2(1895, 'Previous value in history')),
516
+ title: ( localize2(6828, 'Previous value in history')),
519
517
  category: interactiveWindowCategory,
520
518
  f1: false,
521
519
  keybinding: {
522
- when: ( (ContextKeyExpr.and(
523
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('bottom')),
524
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none')),
525
- (Context.Visible.toNegated())
526
- ))),
527
- primary: 16 ,
528
- weight: 200
520
+ when: ( ContextKeyExpr.and(( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('bottom')), ( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none')), ( Context.Visible.toNegated()))),
521
+ primary: KeyCode.UpArrow,
522
+ weight: KeybindingWeight.WorkbenchContrib
529
523
  },
530
- precondition: ( (ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, (NOTEBOOK_EDITOR_FOCUSED.negate()))))
524
+ precondition: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_EDITOR_FOCUSED.negate())))
531
525
  });
532
526
  }
533
527
  async run(accessor) {
@@ -550,19 +544,15 @@ registerAction2(class extends Action2 {
550
544
  constructor() {
551
545
  super({
552
546
  id: 'interactive.history.next',
553
- title: ( localize2(1896, 'Next value in history')),
547
+ title: ( localize2(6829, 'Next value in history')),
554
548
  category: interactiveWindowCategory,
555
549
  f1: false,
556
550
  keybinding: {
557
- when: ( (ContextKeyExpr.and(
558
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('top')),
559
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none')),
560
- (Context.Visible.toNegated())
561
- ))),
562
- primary: 18 ,
563
- weight: 200
551
+ when: ( ContextKeyExpr.and(( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('top')), ( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none')), ( Context.Visible.toNegated()))),
552
+ primary: KeyCode.DownArrow,
553
+ weight: KeybindingWeight.WorkbenchContrib
564
554
  },
565
- precondition: ( (ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, (NOTEBOOK_EDITOR_FOCUSED.negate()))))
555
+ precondition: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_EDITOR_FOCUSED.negate())))
566
556
  });
567
557
  }
568
558
  async run(accessor) {
@@ -585,12 +575,12 @@ registerAction2(class extends Action2 {
585
575
  constructor() {
586
576
  super({
587
577
  id: 'interactive.scrollToTop',
588
- title: ( localize(1897, 'Scroll to Top')),
578
+ title: ( localize(6830, 'Scroll to Top')),
589
579
  keybinding: {
590
- when: ( (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'))),
591
- primary: 2048 | 14 ,
592
- mac: { primary: 2048 | 16 },
593
- weight: 200
580
+ when: ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')),
581
+ primary: KeyMod.CtrlCmd | KeyCode.Home,
582
+ mac: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow },
583
+ weight: KeybindingWeight.WorkbenchContrib
594
584
  },
595
585
  category: interactiveWindowCategory,
596
586
  });
@@ -610,12 +600,12 @@ registerAction2(class extends Action2 {
610
600
  constructor() {
611
601
  super({
612
602
  id: 'interactive.scrollToBottom',
613
- title: ( localize(1898, 'Scroll to Bottom')),
603
+ title: ( localize(6831, 'Scroll to Bottom')),
614
604
  keybinding: {
615
- when: ( (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'))),
616
- primary: 2048 | 13 ,
617
- mac: { primary: 2048 | 18 },
618
- weight: 200
605
+ when: ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')),
606
+ primary: KeyMod.CtrlCmd | KeyCode.End,
607
+ mac: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow },
608
+ weight: KeybindingWeight.WorkbenchContrib
619
609
  },
620
610
  category: interactiveWindowCategory,
621
611
  });
@@ -636,17 +626,12 @@ registerAction2(class extends Action2 {
636
626
  constructor() {
637
627
  super({
638
628
  id: 'interactive.input.focus',
639
- title: ( localize2(1899, 'Focus Input Editor')),
629
+ title: ( localize2(6832, 'Focus Input Editor')),
640
630
  category: interactiveWindowCategory,
641
631
  menu: {
642
632
  id: MenuId.CommandPalette,
643
- when: InteractiveWindowOpen,
633
+ when: InteractiveWindowOpen
644
634
  },
645
- keybinding: {
646
- when: ( (ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED))),
647
- weight: 200 + 5,
648
- primary: 2048 | 18
649
- }
650
635
  });
651
636
  }
652
637
  async run(accessor) {
@@ -656,7 +641,7 @@ registerAction2(class extends Action2 {
656
641
  editorService.activeEditorPane?.focus();
657
642
  }
658
643
  else {
659
- const openEditors = editorService.getEditors(0 );
644
+ const openEditors = editorService.getEditors(EditorsOrder.MOST_RECENTLY_ACTIVE);
660
645
  const interactiveWindow = Iterable.find(openEditors, identifier => { return identifier.editor.typeId === InteractiveEditorInput.ID; });
661
646
  if (interactiveWindow) {
662
647
  const editorInput = interactiveWindow.editor;
@@ -674,26 +659,23 @@ registerAction2(class extends Action2 {
674
659
  constructor() {
675
660
  super({
676
661
  id: 'interactive.history.focus',
677
- title: ( localize2(1900, 'Focus History')),
662
+ title: ( localize2(6833, 'Focus History')),
678
663
  category: interactiveWindowCategory,
679
664
  menu: {
680
665
  id: MenuId.CommandPalette,
681
- when: ( (ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'))),
666
+ when: ( ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive')),
682
667
  },
683
668
  keybinding: [{
684
- when: ( (ContextKeyExpr.and(
685
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('bottom')),
686
- (INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none'))
687
- ))),
688
- weight: 200 + 5,
689
- primary: 2048 | 16
669
+ when: ( ContextKeyExpr.and(( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('bottom')), ( INTERACTIVE_INPUT_CURSOR_BOUNDARY.notEqualsTo('none')))),
670
+ weight: KeybindingWeight.WorkbenchContrib + 5,
671
+ primary: KeyMod.CtrlCmd | KeyCode.UpArrow
690
672
  },
691
673
  {
692
- when: ( (ContextKeyExpr.or(IsWindowsContext, IsLinuxContext))),
693
- weight: 200 ,
694
- primary: 2048 | 16 ,
674
+ when: ( ContextKeyExpr.or(IsWindowsContext, IsLinuxContext)),
675
+ weight: KeybindingWeight.WorkbenchContrib,
676
+ primary: KeyMod.CtrlCmd | KeyCode.UpArrow,
695
677
  }],
696
- precondition: ( (ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, (NOTEBOOK_EDITOR_FOCUSED.negate()))))
678
+ precondition: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_EDITOR_FOCUSED.negate())))
697
679
  });
698
680
  }
699
681
  async run(accessor) {
@@ -710,7 +692,7 @@ registerColor('interactive.activeCodeBorder', {
710
692
  hcDark: contrastBorder,
711
693
  hcLight: contrastBorder
712
694
  }, ( localize(
713
- 1901,
695
+ 6834,
714
696
  'The border color for the current interactive code cell when the editor has focus.'
715
697
  )));
716
698
  registerColor('interactive.inactiveCodeBorder', {
@@ -719,19 +701,19 @@ registerColor('interactive.inactiveCodeBorder', {
719
701
  hcDark: PANEL_BORDER,
720
702
  hcLight: PANEL_BORDER
721
703
  }, ( localize(
722
- 1902,
704
+ 6835,
723
705
  'The border color for the current interactive code cell when the editor does not have focus.'
724
706
  )));
725
- ( (Registry.as(Extensions.Configuration))).registerConfiguration({
707
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
726
708
  id: 'interactiveWindow',
727
709
  order: 100,
728
710
  type: 'object',
729
711
  'properties': {
730
- [InteractiveWindowSetting.interactiveWindowAlwaysScrollOnNewCell]: {
712
+ [ReplEditorSettings.interactiveWindowAlwaysScrollOnNewCell]: {
731
713
  type: 'boolean',
732
714
  default: true,
733
715
  markdownDescription: ( localize(
734
- 1903,
716
+ 6836,
735
717
  "Automatically scroll the interactive window to show the output of the last statement executed. If this value is false, the window will only scroll if the last cell was already the one scrolled to."
736
718
  ))
737
719
  },
@@ -739,24 +721,24 @@ registerColor('interactive.inactiveCodeBorder', {
739
721
  type: 'boolean',
740
722
  default: false,
741
723
  markdownDescription: ( localize(
742
- 1904,
724
+ 6837,
743
725
  "Prompt to save the interactive window when it is closed. Only new interactive windows will be affected by this setting change."
744
726
  ))
745
727
  },
746
- [InteractiveWindowSetting.executeWithShiftEnter]: {
728
+ [ReplEditorSettings.executeWithShiftEnter]: {
747
729
  type: 'boolean',
748
730
  default: false,
749
731
  markdownDescription: ( localize(
750
- 1905,
732
+ 6838,
751
733
  "Execute the Interactive Window (REPL) input box with shift+enter, so that enter can be used to create a newline."
752
734
  )),
753
735
  tags: ['replExecute']
754
736
  },
755
- [InteractiveWindowSetting.showExecutionHint]: {
737
+ [ReplEditorSettings.showExecutionHint]: {
756
738
  type: 'boolean',
757
739
  default: true,
758
740
  markdownDescription: ( localize(
759
- 1906,
741
+ 6839,
760
742
  "Display a hint in the Interactive Window (REPL) input box to indicate how to execute code."
761
743
  )),
762
744
  tags: ['replExecute']
@@ -0,0 +1,7 @@
1
+ import { RawContextKey } from "vscode/vscode/vs/platform/contextkey/common/contextkey";
2
+ export declare const INTERACTIVE_INPUT_CURSOR_BOUNDARY: RawContextKey<"both" | "none" | "top" | "bottom">;
3
+ export declare const ReplEditorSettings: {
4
+ interactiveWindowAlwaysScrollOnNewCell: string;
5
+ executeWithShiftEnter: string;
6
+ showExecutionHint: string;
7
+ };
@@ -1,10 +1,11 @@
1
+
1
2
  import { RawContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
2
3
 
3
4
  const INTERACTIVE_INPUT_CURSOR_BOUNDARY = ( new RawContextKey('interactiveInputCursorAtBoundary', 'none'));
4
- const InteractiveWindowSetting = {
5
+ const ReplEditorSettings = {
5
6
  interactiveWindowAlwaysScrollOnNewCell: 'interactiveWindow.alwaysScrollOnNewCell',
6
7
  executeWithShiftEnter: 'interactiveWindow.executeWithShiftEnter',
7
- showExecutionHint: 'interactiveWindow.showExecutionHint'
8
+ showExecutionHint: 'interactiveWindow.showExecutionHint',
8
9
  };
9
10
 
10
- export { INTERACTIVE_INPUT_CURSOR_BOUNDARY, InteractiveWindowSetting };
11
+ export { INTERACTIVE_INPUT_CURSOR_BOUNDARY, ReplEditorSettings };