@codingame/monaco-vscode-dialogs-service-override 3.2.3 → 4.1.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.
@@ -1,72 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import Severity from 'vscode/vscode/vs/base/common/severity';
3
- import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
- import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
5
- import { DialogsModel } from '../../../common/dialogs.js';
6
- import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService';
7
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
8
-
9
- let DialogService = class DialogService extends Disposable {
10
- constructor(environmentService, logService) {
11
- super();
12
- this.environmentService = environmentService;
13
- this.logService = logService;
14
- this.model = this._register(( new DialogsModel()));
15
- this.onWillShowDialog = this.model.onWillShowDialog;
16
- this.onDidShowDialog = this.model.onDidShowDialog;
17
- }
18
- skipDialogs() {
19
- if (this.environmentService.isExtensionDevelopment && this.environmentService.extensionTestsLocationURI) {
20
- return true;
21
- }
22
- return !!this.environmentService.enableSmokeTestDriver;
23
- }
24
- async confirm(confirmation) {
25
- if (this.skipDialogs()) {
26
- this.logService.trace('DialogService: refused to show confirmation dialog in tests.');
27
- return { confirmed: true };
28
- }
29
- const handle = this.model.show({ confirmArgs: { confirmation } });
30
- return await handle.result;
31
- }
32
- async prompt(prompt) {
33
- if (this.skipDialogs()) {
34
- throw new Error(`DialogService: refused to show dialog in tests. Contents: ${prompt.message}`);
35
- }
36
- const handle = this.model.show({ promptArgs: { prompt } });
37
- const dialogResult = await handle.result;
38
- return {
39
- result: await dialogResult.result,
40
- checkboxChecked: dialogResult.checkboxChecked
41
- };
42
- }
43
- async input(input) {
44
- if (this.skipDialogs()) {
45
- throw new Error('DialogService: refused to show input dialog in tests.');
46
- }
47
- const handle = this.model.show({ inputArgs: { input } });
48
- return await handle.result;
49
- }
50
- async info(message, detail) {
51
- await this.prompt({ type: Severity.Info, message, detail });
52
- }
53
- async warn(message, detail) {
54
- await this.prompt({ type: Severity.Warning, message, detail });
55
- }
56
- async error(message, detail) {
57
- await this.prompt({ type: Severity.Error, message, detail });
58
- }
59
- async about() {
60
- if (this.skipDialogs()) {
61
- throw new Error('DialogService: refused to show about dialog in tests.');
62
- }
63
- const handle = this.model.show({});
64
- await handle.result;
65
- }
66
- };
67
- DialogService = ( __decorate([
68
- ( __param(0, IWorkbenchEnvironmentService)),
69
- ( __param(1, ILogService))
70
- ], DialogService));
71
-
72
- export { DialogService };