@codingame/monaco-vscode-interactive-service-override 2.2.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-interactive-service-override",
3
- "version": "2.2.2",
3
+ "version": "3.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,7 +18,7 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@2.2.2",
21
+ "vscode": "npm:@codingame/monaco-vscode-api@3.0.0",
22
22
  "vscode-marked": "npm:marked@=3.0.2"
23
23
  }
24
24
  }
@@ -5,7 +5,6 @@ import { parse } from 'vscode/vscode/vs/base/common/marshalling';
5
5
  import { Schemas } from 'vscode/vscode/vs/base/common/network';
6
6
  import { extname, isEqual } from 'vscode/vscode/vs/base/common/resources';
7
7
  import { isFalsyOrWhitespace } from 'vscode/vscode/vs/base/common/strings';
8
- import { assertType } from 'vscode/vscode/vs/base/common/types';
9
8
  import { URI } from 'vscode/vscode/vs/base/common/uri';
10
9
  import { IBulkEditService } from 'vscode/vscode/vs/editor/browser/services/bulkEditService';
11
10
  import { EditOperation } from 'vscode/vscode/vs/editor/common/core/editOperation';
@@ -14,10 +13,10 @@ import { IModelService } from 'vscode/vscode/vs/editor/common/services/model';
14
13
  import { ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
15
14
  import { peekViewBorder } from 'vscode/vscode/vs/editor/contrib/peekView/browser/peekView';
16
15
  import { Context } from 'vscode/vscode/vs/editor/contrib/suggest/browser/suggest';
17
- import { localizeWithPath, localize2WithPath } from 'vscode/vscode/vs/nls';
16
+ import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
18
17
  import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
19
18
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
20
- import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
19
+ import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
21
20
  import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
22
21
  import { EditorActivation } from 'vscode/vscode/vs/platform/editor/common/editor';
23
22
  import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
@@ -26,7 +25,7 @@ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
26
25
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
27
26
  import { registerColor, ifDefinedThenElse, contrastBorder, listInactiveSelectionBackground } from 'vscode/vscode/vs/platform/theme/common/colorRegistry';
28
27
  import { EditorPaneDescriptor } from 'vscode/vscode/vs/workbench/browser/editor';
29
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
28
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
30
29
  import { EditorExtensions } from 'vscode/vscode/vs/workbench/common/editor';
31
30
  import { PANEL_BORDER } from 'vscode/vscode/vs/workbench/common/theme';
32
31
  import { ResourceNotebookCellEdit } from 'vscode/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
@@ -37,7 +36,7 @@ import { IInteractiveHistoryService } from 'vscode/vscode/vs/workbench/contrib/i
37
36
  import { NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
38
37
  import { executeIcon } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
39
38
  import { INotebookEditorService } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService';
40
- import { INTERACTIVE_WINDOW_EDITOR_ID, CellKind, CellUri, NotebookWorkingCopyTypeIdentifier } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
39
+ import { INTERACTIVE_WINDOW_EDITOR_ID, CellUri, NotebookWorkingCopyTypeIdentifier, CellKind } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
41
40
  import { InteractiveWindowOpen } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
42
41
  import { INotebookKernelService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
43
42
  import { INotebookService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookService';
@@ -48,15 +47,16 @@ import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/commo
48
47
  import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions';
49
48
  import { IWorkingCopyEditorService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyEditorService';
50
49
 
51
- const interactiveWindowCategory = { value: ( localizeWithPath(
50
+ const interactiveWindowCategory = ( localize2WithPath(
52
51
  'vs/workbench/contrib/interactive/browser/interactive.contribution',
53
52
  'interactiveWindow',
54
- 'Interactive Window'
55
- )), original: 'Interactive Window' };
53
+ "Interactive Window"
54
+ ));
56
55
  ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(InteractiveEditor, INTERACTIVE_WINDOW_EDITOR_ID, 'Interactive Window'), [
57
56
  ( new SyncDescriptor(InteractiveEditorInput))
58
57
  ]);
59
58
  let InteractiveDocumentContribution = class InteractiveDocumentContribution extends Disposable {
59
+ static { this.ID = 'workbench.contrib.interactiveDocument'; }
60
60
  constructor(notebookService, editorResolverService, editorService, instantiationService) {
61
61
  super();
62
62
  this.instantiationService = instantiationService;
@@ -132,6 +132,7 @@ InteractiveDocumentContribution = ( __decorate([
132
132
  ( __param(3, IInstantiationService))
133
133
  ], InteractiveDocumentContribution));
134
134
  let InteractiveInputContentProvider = class InteractiveInputContentProvider {
135
+ static { this.ID = 'workbench.contrib.interactiveInputContentProvider'; }
135
136
  constructor(textModelService, _modelService) {
136
137
  this._modelService = _modelService;
137
138
  this._registration = textModelService.registerTextModelContentProvider(Schemas.vscodeInteractiveInput, this);
@@ -160,6 +161,7 @@ function createEditor(resource, instantiationService) {
160
161
  return editorInput;
161
162
  }
162
163
  let InteractiveWindowWorkingCopyEditorHandler = class InteractiveWindowWorkingCopyEditorHandler extends Disposable {
164
+ static { this.ID = 'workbench.contrib.interactiveWindowWorkingCopyEditorHandler'; }
163
165
  constructor(_instantiationService, _workingCopyEditorService, _extensionService) {
164
166
  super();
165
167
  this._instantiationService = _instantiationService;
@@ -193,18 +195,21 @@ InteractiveWindowWorkingCopyEditorHandler = ( __decorate([
193
195
  ( __param(1, IWorkingCopyEditorService)),
194
196
  ( __param(2, IExtensionService))
195
197
  ], InteractiveWindowWorkingCopyEditorHandler));
196
- const workbenchContributionsRegistry = ( Registry.as(Extensions.Workbench));
197
- workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveDocumentContribution, 2 );
198
- workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveInputContentProvider, 2 );
199
- workbenchContributionsRegistry.registerWorkbenchContribution(InteractiveWindowWorkingCopyEditorHandler, 2 );
198
+ registerWorkbenchContribution2(InteractiveDocumentContribution.ID, InteractiveDocumentContribution, 2 );
199
+ registerWorkbenchContribution2(InteractiveInputContentProvider.ID, InteractiveInputContentProvider, 2 );
200
+ registerWorkbenchContribution2(InteractiveWindowWorkingCopyEditorHandler.ID, InteractiveWindowWorkingCopyEditorHandler, 2 );
200
201
  class InteractiveEditorSerializer {
201
202
  static { this.ID = InteractiveEditorInput.ID; }
202
203
  canSerialize(editor) {
203
- const interactiveEditorInput = editor;
204
- return URI.isUri(interactiveEditorInput?.primary?.resource) && URI.isUri(interactiveEditorInput?.inputResource);
204
+ if (!(editor instanceof InteractiveEditorInput)) {
205
+ return false;
206
+ }
207
+ return URI.isUri(editor.primary.resource) && URI.isUri(editor.inputResource);
205
208
  }
206
209
  serialize(input) {
207
- assertType(input instanceof InteractiveEditorInput);
210
+ if (!this.canSerialize(input)) {
211
+ return undefined;
212
+ }
208
213
  return JSON.stringify({
209
214
  resource: input.primary.resource,
210
215
  inputResource: input.inputResource,
@@ -683,7 +688,7 @@ registerColor('interactive.inactiveCodeBorder', {
683
688
  'interactive.inactiveCodeBorder',
684
689
  'The border color for the current interactive code cell when the editor does not have focus.'
685
690
  )));
686
- ( Registry.as(Extensions$1.Configuration)).registerConfiguration({
691
+ ( Registry.as(Extensions.Configuration)).registerConfiguration({
687
692
  id: 'interactiveWindow',
688
693
  order: 100,
689
694
  type: 'object',
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
2
  import './media/interactive.css.js';
3
3
  import { localizeWithPath } from 'vscode/vscode/vs/nls';
4
- import { append, $, createStyleSheet, getWindow, Dimension } from 'vscode/vscode/vs/base/browser/dom';
4
+ import { getWindowById, append, $, createStyleSheet, getWindow, Dimension } from 'vscode/vscode/vs/base/browser/dom';
5
5
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
6
6
  import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
7
7
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
@@ -85,8 +85,10 @@ let InteractiveEditor = class InteractiveEditor extends EditorPane {
85
85
  }
86
86
  }));
87
87
  this._notebookOptions = ( new NotebookOptions(
88
+ getWindowById(this.group?.windowId, true).window ?? mainWindow,
88
89
  configurationService,
89
90
  notebookExecutionStateService,
91
+ codeEditorService,
90
92
  true,
91
93
  { cellToolbarInteraction: 'hover', globalToolbar: true, stickyScrollEnabled: false, dragAndDropEnabled: false }
92
94
  ));
@@ -125,8 +127,8 @@ let InteractiveEditor = class InteractiveEditor extends EditorPane {
125
127
  const menu = this._register(this._menuService.createMenu(MenuId.InteractiveInputExecute, this._contextKeyService));
126
128
  this._runbuttonToolbar = this._register(( new ToolBar(runButtonContainer, this._contextMenuService, {
127
129
  getKeyBinding: action => this._keybindingService.lookupKeybinding(action.id),
128
- actionViewItemProvider: action => {
129
- return createActionViewItem(this._instantiationService, action);
130
+ actionViewItemProvider: (action, options) => {
131
+ return createActionViewItem(this._instantiationService, action, options);
130
132
  },
131
133
  renderDropdownAsChildElement: true
132
134
  })));