@codingame/monaco-vscode-dialogs-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-dialogs-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,25 +5,26 @@ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/
5
5
  import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService';
6
6
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
7
7
  import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService';
8
- import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
9
- import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
8
+ import { registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions';
10
9
  import { BrowserDialogHandler } from './dialogHandler.js';
11
10
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
12
11
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
12
+ import { Lazy } from 'vscode/vscode/vs/base/common/lazy';
13
13
  import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
14
14
 
15
15
  let DialogHandlerContribution = class DialogHandlerContribution extends Disposable {
16
+ static { this.ID = 'workbench.contrib.dialogHandler'; }
16
17
  constructor(dialogService, logService, layoutService, keybindingService, instantiationService, productService, clipboardService) {
17
18
  super();
18
19
  this.dialogService = dialogService;
19
- this.impl = ( new BrowserDialogHandler(
20
+ this.impl = ( new Lazy(() => ( new BrowserDialogHandler(
20
21
  logService,
21
22
  layoutService,
22
23
  keybindingService,
23
24
  instantiationService,
24
25
  productService,
25
26
  clipboardService
26
- ));
27
+ ))));
27
28
  this.model = this.dialogService.model;
28
29
  this._register(this.model.onWillShowDialog(() => {
29
30
  if (!this.currentDialog) {
@@ -39,18 +40,18 @@ let DialogHandlerContribution = class DialogHandlerContribution extends Disposab
39
40
  try {
40
41
  if (this.currentDialog.args.confirmArgs) {
41
42
  const args = this.currentDialog.args.confirmArgs;
42
- result = await this.impl.confirm(args.confirmation);
43
+ result = await this.impl.value.confirm(args.confirmation);
43
44
  }
44
45
  else if (this.currentDialog.args.inputArgs) {
45
46
  const args = this.currentDialog.args.inputArgs;
46
- result = await this.impl.input(args.input);
47
+ result = await this.impl.value.input(args.input);
47
48
  }
48
49
  else if (this.currentDialog.args.promptArgs) {
49
50
  const args = this.currentDialog.args.promptArgs;
50
- result = await this.impl.prompt(args.prompt);
51
+ result = await this.impl.value.prompt(args.prompt);
51
52
  }
52
53
  else {
53
- await this.impl.about();
54
+ await this.impl.value.about();
54
55
  }
55
56
  }
56
57
  catch (error) {
@@ -70,7 +71,6 @@ DialogHandlerContribution = ( __decorate([
70
71
  ( __param(5, IProductService)),
71
72
  ( __param(6, IClipboardService))
72
73
  ], DialogHandlerContribution));
73
- const workbenchRegistry = ( Registry.as(Extensions.Workbench));
74
- workbenchRegistry.registerWorkbenchContribution(DialogHandlerContribution, 1 );
74
+ registerWorkbenchContribution2(DialogHandlerContribution.ID, DialogHandlerContribution, 1 );
75
75
 
76
76
  export { DialogHandlerContribution };