@theia/monaco 1.45.0 → 1.46.0-next.72
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/README.md +100 -100
- package/data/monaco-nls.json +1379 -1379
- package/data/monaco-themes/vscode/dark_plus.json +201 -201
- package/data/monaco-themes/vscode/dark_theia.json +5 -5
- package/data/monaco-themes/vscode/dark_vs.json +393 -393
- package/data/monaco-themes/vscode/hc_black.json +457 -457
- package/data/monaco-themes/vscode/hc_light.json +590 -590
- package/data/monaco-themes/vscode/hc_theia.json +5 -5
- package/data/monaco-themes/vscode/hc_theia_light.json +5 -5
- package/data/monaco-themes/vscode/light_plus.json +202 -202
- package/data/monaco-themes/vscode/light_theia.json +10 -10
- package/data/monaco-themes/vscode/light_vs.json +421 -421
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +28 -28
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts +20 -24
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js +122 -137
- package/lib/browser/markdown-renderer/monaco-markdown-renderer.js.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.d.ts +12 -14
- package/lib/browser/monaco-bulk-edit-service.d.ts.map +1 -1
- package/lib/browser/monaco-bulk-edit-service.js +66 -66
- package/lib/browser/monaco-bulk-edit-service.js.map +1 -1
- package/lib/browser/monaco-color-registry.d.ts +16 -16
- package/lib/browser/monaco-color-registry.js +82 -82
- package/lib/browser/monaco-command-registry.d.ts +19 -19
- package/lib/browser/monaco-command-registry.d.ts.map +1 -1
- package/lib/browser/monaco-command-registry.js +88 -85
- package/lib/browser/monaco-command-registry.js.map +1 -1
- package/lib/browser/monaco-command-service.d.ts +21 -26
- package/lib/browser/monaco-command-service.d.ts.map +1 -1
- package/lib/browser/monaco-command-service.js +93 -92
- package/lib/browser/monaco-command-service.js.map +1 -1
- package/lib/browser/monaco-command.d.ts +88 -94
- package/lib/browser/monaco-command.d.ts.map +1 -1
- package/lib/browser/monaco-command.js +294 -307
- package/lib/browser/monaco-command.js.map +1 -1
- package/lib/browser/monaco-context-key-service.d.ts +22 -22
- package/lib/browser/monaco-context-key-service.d.ts.map +1 -1
- package/lib/browser/monaco-context-key-service.js +146 -147
- package/lib/browser/monaco-context-key-service.js.map +1 -1
- package/lib/browser/monaco-context-menu.d.ts +17 -16
- package/lib/browser/monaco-context-menu.d.ts.map +1 -1
- package/lib/browser/monaco-context-menu.js +112 -102
- package/lib/browser/monaco-context-menu.js.map +1 -1
- package/lib/browser/monaco-diff-editor.d.ts +29 -29
- package/lib/browser/monaco-diff-editor.d.ts.map +1 -1
- package/lib/browser/monaco-diff-editor.js +74 -74
- package/lib/browser/monaco-diff-editor.js.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.d.ts +6 -7
- package/lib/browser/monaco-diff-navigator-factory.d.ts.map +1 -1
- package/lib/browser/monaco-diff-navigator-factory.js +45 -66
- package/lib/browser/monaco-diff-navigator-factory.js.map +1 -1
- package/lib/browser/monaco-editor-model.d.ts +158 -156
- package/lib/browser/monaco-editor-model.d.ts.map +1 -1
- package/lib/browser/monaco-editor-model.js +562 -559
- package/lib/browser/monaco-editor-model.js.map +1 -1
- package/lib/browser/monaco-editor-provider.d.ts +70 -89
- package/lib/browser/monaco-editor-provider.d.ts.map +1 -1
- package/lib/browser/monaco-editor-provider.js +386 -440
- package/lib/browser/monaco-editor-provider.js.map +1 -1
- package/lib/browser/monaco-editor-service.d.ts +32 -27
- package/lib/browser/monaco-editor-service.d.ts.map +1 -1
- package/lib/browser/monaco-editor-service.js +158 -155
- package/lib/browser/monaco-editor-service.js.map +1 -1
- package/lib/browser/monaco-editor-zone-widget.d.ts +43 -43
- package/lib/browser/monaco-editor-zone-widget.js +194 -194
- package/lib/browser/monaco-editor.d.ts +154 -151
- package/lib/browser/monaco-editor.d.ts.map +1 -1
- package/lib/browser/monaco-editor.js +542 -524
- package/lib/browser/monaco-editor.js.map +1 -1
- package/lib/browser/monaco-formatting-conflicts.d.ts +13 -13
- package/lib/browser/monaco-formatting-conflicts.js +111 -111
- package/lib/browser/monaco-formatting-conflicts.js.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.d.ts +22 -28
- package/lib/browser/monaco-frontend-application-contribution.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-application-contribution.js +178 -215
- package/lib/browser/monaco-frontend-application-contribution.js.map +1 -1
- package/lib/browser/monaco-frontend-module.d.ts +7 -7
- package/lib/browser/monaco-frontend-module.d.ts.map +1 -1
- package/lib/browser/monaco-frontend-module.js +280 -271
- package/lib/browser/monaco-frontend-module.js.map +1 -1
- package/lib/browser/monaco-gotoline-quick-access.d.ts +11 -11
- package/lib/browser/monaco-gotoline-quick-access.js +64 -64
- package/lib/browser/monaco-gotosymbol-quick-access.d.ts +16 -16
- package/lib/browser/monaco-gotosymbol-quick-access.js +70 -70
- package/lib/browser/monaco-icon-registry.d.ts +10 -11
- package/lib/browser/monaco-icon-registry.d.ts.map +1 -1
- package/lib/browser/monaco-icon-registry.js +52 -50
- package/lib/browser/monaco-icon-registry.js.map +1 -1
- package/lib/browser/monaco-indexed-db.d.ts +28 -28
- package/lib/browser/monaco-indexed-db.js +131 -131
- package/lib/browser/monaco-init.d.ts +5 -0
- package/lib/browser/monaco-init.d.ts.map +1 -0
- package/lib/browser/monaco-init.js +125 -0
- package/lib/browser/monaco-init.js.map +1 -0
- package/lib/browser/monaco-keybinding.d.ts +16 -16
- package/lib/browser/monaco-keybinding.js +134 -134
- package/lib/browser/monaco-keybinding.js.map +1 -1
- package/lib/browser/monaco-keycode-map.d.ts +2 -2
- package/lib/browser/monaco-keycode-map.js +163 -163
- package/lib/browser/monaco-keycode-map.js.map +1 -1
- package/lib/browser/monaco-languages.d.ts +35 -35
- package/lib/browser/monaco-languages.js +180 -180
- package/lib/browser/monaco-marker-collection.d.ts +18 -18
- package/lib/browser/monaco-marker-collection.js +70 -70
- package/lib/browser/monaco-menu.d.ts +20 -20
- package/lib/browser/monaco-menu.js +145 -145
- package/lib/browser/monaco-mime-service.d.ts +10 -10
- package/lib/browser/monaco-mime-service.js +78 -78
- package/lib/browser/monaco-outline-contribution.d.ts +78 -78
- package/lib/browser/monaco-outline-contribution.js +384 -384
- package/lib/browser/monaco-outline-decorator.d.ts +12 -12
- package/lib/browser/monaco-outline-decorator.js +67 -67
- package/lib/browser/monaco-quick-access-registry.d.ts +11 -11
- package/lib/browser/monaco-quick-access-registry.js +99 -99
- package/lib/browser/monaco-quick-input-service.d.ts +99 -101
- package/lib/browser/monaco-quick-input-service.d.ts.map +1 -1
- package/lib/browser/monaco-quick-input-service.js +529 -568
- package/lib/browser/monaco-quick-input-service.js.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.d.ts +23 -23
- package/lib/browser/monaco-resolved-keybinding.d.ts.map +1 -1
- package/lib/browser/monaco-resolved-keybinding.js +131 -131
- package/lib/browser/monaco-resolved-keybinding.js.map +1 -1
- package/lib/browser/monaco-snippet-suggest-provider.d.ts +66 -66
- package/lib/browser/monaco-snippet-suggest-provider.js +273 -273
- package/lib/browser/monaco-status-bar-contribution.d.ts +17 -17
- package/lib/browser/monaco-status-bar-contribution.js +121 -121
- package/lib/browser/monaco-text-model-service.d.ts +51 -51
- package/lib/browser/monaco-text-model-service.js +189 -189
- package/lib/browser/monaco-text-model-service.js.map +1 -1
- package/lib/browser/monaco-theming-service.d.ts +67 -67
- package/lib/browser/monaco-theming-service.js +171 -171
- package/lib/browser/monaco-to-protocol-converter.d.ts +26 -26
- package/lib/browser/monaco-to-protocol-converter.js +61 -61
- package/lib/browser/monaco-workspace.d.ts +83 -85
- package/lib/browser/monaco-workspace.d.ts.map +1 -1
- package/lib/browser/monaco-workspace.js +384 -384
- package/lib/browser/monaco-workspace.js.map +1 -1
- package/lib/browser/protocol-to-monaco-converter.d.ts +31 -31
- package/lib/browser/protocol-to-monaco-converter.js +133 -133
- package/lib/browser/simple-monaco-editor.d.ts +45 -44
- package/lib/browser/simple-monaco-editor.d.ts.map +1 -1
- package/lib/browser/simple-monaco-editor.js +184 -176
- package/lib/browser/simple-monaco-editor.js.map +1 -1
- package/lib/browser/textmate/index.d.ts +4 -4
- package/lib/browser/textmate/index.js +31 -31
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.d.ts +11 -11
- package/lib/browser/textmate/monaco-textmate-frontend-bindings.js +91 -91
- package/lib/browser/textmate/monaco-textmate-service.d.ts +30 -30
- package/lib/browser/textmate/monaco-textmate-service.js +185 -185
- package/lib/browser/textmate/monaco-textmate-service.js.map +1 -1
- package/lib/browser/textmate/monaco-theme-registry.d.ts +27 -27
- package/lib/browser/textmate/monaco-theme-registry.js +173 -173
- package/lib/browser/textmate/monaco-theme-types.d.ts +20 -20
- package/lib/browser/textmate/monaco-theme-types.js +21 -21
- package/lib/browser/textmate/textmate-contribution.d.ts +9 -9
- package/lib/browser/textmate/textmate-contribution.js +27 -27
- package/lib/browser/textmate/textmate-registry.d.ts +31 -31
- package/lib/browser/textmate/textmate-registry.js +109 -109
- package/lib/browser/textmate/textmate-snippet-completion-provider.d.ts +26 -26
- package/lib/browser/textmate/textmate-snippet-completion-provider.js +53 -53
- package/lib/browser/textmate/textmate-tokenizer.d.ts +22 -22
- package/lib/browser/textmate/textmate-tokenizer.js +65 -65
- package/lib/browser/workspace-symbol-command.d.ts +55 -55
- package/lib/browser/workspace-symbol-command.js +215 -215
- package/lib/package.spec.js +25 -25
- package/package.json +10 -10
- package/src/browser/index.ts +17 -17
- package/src/browser/markdown-renderer/monaco-markdown-renderer.ts +109 -117
- package/src/browser/monaco-bulk-edit-service.ts +64 -64
- package/src/browser/monaco-color-registry.ts +73 -73
- package/src/browser/monaco-command-registry.ts +85 -82
- package/src/browser/monaco-command-service.ts +90 -99
- package/src/browser/monaco-command.ts +303 -313
- package/src/browser/monaco-context-key-service.ts +144 -143
- package/src/browser/monaco-context-menu.ts +100 -90
- package/src/browser/monaco-diff-editor.ts +100 -101
- package/src/browser/monaco-diff-navigator-factory.ts +39 -61
- package/src/browser/monaco-editor-model.ts +684 -681
- package/src/browser/monaco-editor-provider.ts +409 -452
- package/src/browser/monaco-editor-service.ts +149 -144
- package/src/browser/monaco-editor-zone-widget.ts +250 -250
- package/src/browser/monaco-editor.ts +663 -644
- package/src/browser/monaco-formatting-conflicts.ts +116 -116
- package/src/browser/monaco-frontend-application-contribution.ts +165 -200
- package/src/browser/monaco-frontend-module.ts +328 -320
- package/src/browser/monaco-gotoline-quick-access.ts +47 -47
- package/src/browser/monaco-gotosymbol-quick-access.ts +53 -53
- package/src/browser/monaco-icon-registry.ts +49 -47
- package/src/browser/monaco-indexed-db.ts +130 -130
- package/src/browser/monaco-init.ts +114 -0
- package/src/browser/monaco-keybinding.ts +111 -111
- package/src/browser/monaco-keycode-map.ts +171 -171
- package/src/browser/monaco-languages.ts +177 -177
- package/src/browser/monaco-marker-collection.ts +83 -83
- package/src/browser/monaco-menu.ts +142 -142
- package/src/browser/monaco-mime-service.ts +71 -71
- package/src/browser/monaco-outline-contribution.ts +404 -404
- package/src/browser/monaco-outline-decorator.ts +66 -66
- package/src/browser/monaco-quick-access-registry.ts +112 -112
- package/src/browser/monaco-quick-input-service.ts +647 -676
- package/src/browser/monaco-resolved-keybinding.ts +162 -162
- package/src/browser/monaco-snippet-suggest-provider.ts +306 -306
- package/src/browser/monaco-status-bar-contribution.ts +110 -110
- package/src/browser/monaco-text-model-service.ts +199 -199
- package/src/browser/monaco-theming-service.ts +204 -204
- package/src/browser/monaco-to-protocol-converter.ts +71 -71
- package/src/browser/monaco-workspace.ts +412 -412
- package/src/browser/protocol-to-monaco-converter.ts +158 -158
- package/src/browser/simple-monaco-editor.ts +217 -210
- package/src/browser/style/index.css +263 -263
- package/src/browser/textmate/index.ts +20 -20
- package/src/browser/textmate/monaco-textmate-frontend-bindings.ts +90 -90
- package/src/browser/textmate/monaco-textmate-service.ts +187 -187
- package/src/browser/textmate/monaco-theme-registry.ts +176 -176
- package/src/browser/textmate/monaco-theme-types.ts +37 -37
- package/src/browser/textmate/textmate-contribution.ts +29 -29
- package/src/browser/textmate/textmate-registry.ts +129 -129
- package/src/browser/textmate/textmate-snippet-completion-provider.ts +73 -73
- package/src/browser/textmate/textmate-tokenizer.ts +84 -84
- package/src/browser/workspace-symbol-command.ts +196 -196
- package/src/package.spec.ts +28 -28
|
@@ -1,569 +1,530 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.MonacoQuickPickItem = exports.MonacoQuickInputService = exports.MonacoQuickInputImplementation = void 0;
|
|
28
|
-
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
-
const
|
|
31
|
-
const monaco_resolved_keybinding_1 = require("./monaco-resolved-keybinding");
|
|
32
|
-
const quickAccess_1 = require("@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess");
|
|
33
|
-
const
|
|
34
|
-
const listWidget_1 = require("@theia/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget");
|
|
35
|
-
const instantiation_1 = require("@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation");
|
|
36
|
-
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
37
|
-
const core_1 = require("@theia/core");
|
|
38
|
-
const monaco_color_registry_1 = require("./monaco-color-registry");
|
|
39
|
-
const theming_1 = require("@theia/core/lib/browser/theming");
|
|
40
|
-
const standaloneTheme_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme");
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
get
|
|
45
|
-
get
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
52
|
-
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
this.
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
if (
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
wrapped.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
this.wrapped
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
this.
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
this.wrapped.
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
this.
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
this.
|
|
460
|
-
item
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
this.wrapped.
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
this.wrapped.
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
return
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
this.
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
this.
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
* Monaco doesn't check for deep equality when setting the `activeItems` or `selectedItems`.
|
|
531
|
-
* Instead we have to find the references of the monaco wrappers that contain the selected/active items
|
|
532
|
-
*/
|
|
533
|
-
findMonacoItemReferences(source, items) {
|
|
534
|
-
const monacoReferences = [];
|
|
535
|
-
for (const item of items) {
|
|
536
|
-
for (const wrappedItem of source) {
|
|
537
|
-
if (!browser_1.QuickPickSeparator.is(wrappedItem) && wrappedItem.item === item) {
|
|
538
|
-
monacoReferences.push(wrappedItem);
|
|
539
|
-
}
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
return monacoReferences;
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
class MonacoQuickPickItem {
|
|
546
|
-
constructor(item, kbRegistry) {
|
|
547
|
-
var _a;
|
|
548
|
-
this.item = item;
|
|
549
|
-
this.type = item.type;
|
|
550
|
-
this.id = item.id;
|
|
551
|
-
this.label = item.label;
|
|
552
|
-
this.meta = item.meta;
|
|
553
|
-
this.ariaLabel = item.ariaLabel;
|
|
554
|
-
this.description = item.description;
|
|
555
|
-
this.detail = item.detail;
|
|
556
|
-
this.keybinding = item.keySequence ? new monaco_resolved_keybinding_1.MonacoResolvedKeybinding(item.keySequence, kbRegistry) : undefined;
|
|
557
|
-
this.iconClasses = item.iconClasses;
|
|
558
|
-
this.buttons = (_a = item.buttons) === null || _a === void 0 ? void 0 : _a.map(browser_1.QuickInputButton.normalize);
|
|
559
|
-
this.alwaysShow = item.alwaysShow;
|
|
560
|
-
this.highlights = item.highlights;
|
|
561
|
-
}
|
|
562
|
-
accept() {
|
|
563
|
-
if (this.item.execute) {
|
|
564
|
-
this.item.execute();
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
exports.MonacoQuickPickItem = MonacoQuickPickItem;
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2021 SAP SE or an SAP affiliate company and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
+
};
|
|
23
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.MonacoQuickPickItem = exports.MonacoQuickInputService = exports.MonacoQuickInputImplementation = void 0;
|
|
28
|
+
const browser_1 = require("@theia/core/lib/browser");
|
|
29
|
+
const inversify_1 = require("@theia/core/shared/inversify");
|
|
30
|
+
const quickInputController_1 = require("@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickInputController");
|
|
31
|
+
const monaco_resolved_keybinding_1 = require("./monaco-resolved-keybinding");
|
|
32
|
+
const quickAccess_1 = require("@theia/monaco-editor-core/esm/vs/platform/quickinput/browser/quickAccess");
|
|
33
|
+
const contextkey_1 = require("@theia/monaco-editor-core/esm/vs/platform/contextkey/common/contextkey");
|
|
34
|
+
const listWidget_1 = require("@theia/monaco-editor-core/esm/vs/base/browser/ui/list/listWidget");
|
|
35
|
+
const instantiation_1 = require("@theia/monaco-editor-core/esm/vs/platform/instantiation/common/instantiation");
|
|
36
|
+
const standaloneServices_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices");
|
|
37
|
+
const core_1 = require("@theia/core");
|
|
38
|
+
const monaco_color_registry_1 = require("./monaco-color-registry");
|
|
39
|
+
const theming_1 = require("@theia/core/lib/browser/theming");
|
|
40
|
+
const standaloneTheme_1 = require("@theia/monaco-editor-core/esm/vs/editor/standalone/common/standaloneTheme");
|
|
41
|
+
const colorRegistry_1 = require("@theia/monaco-editor-core/esm/vs/platform/theme/common/colorRegistry");
|
|
42
|
+
const defaultStyles_1 = require("@theia/monaco-editor-core/esm/vs/platform/theme/browser/defaultStyles");
|
|
43
|
+
let MonacoQuickInputImplementation = class MonacoQuickInputImplementation {
|
|
44
|
+
get backButton() { return this.controller.backButton; }
|
|
45
|
+
get onShow() { return this.controller.onShow; }
|
|
46
|
+
get onHide() { return this.controller.onHide; }
|
|
47
|
+
init() {
|
|
48
|
+
this.initContainer();
|
|
49
|
+
this.initController();
|
|
50
|
+
this.quickAccess = new quickAccess_1.QuickAccessController(this, standaloneServices_1.StandaloneServices.get(instantiation_1.IInstantiationService));
|
|
51
|
+
this.inQuickOpen = standaloneServices_1.StandaloneServices.get(contextkey_1.IContextKeyService).createKey('inQuickOpen', false);
|
|
52
|
+
this.controller.onShow(() => {
|
|
53
|
+
this.container.style.top = this.shell.mainPanel.node.getBoundingClientRect().top + 'px';
|
|
54
|
+
this.inQuickOpen.set(true);
|
|
55
|
+
});
|
|
56
|
+
this.controller.onHide(() => this.inQuickOpen.set(false));
|
|
57
|
+
this.themeService.initialized.then(() => this.controller.applyStyles(this.computeStyles()));
|
|
58
|
+
// Hook into the theming service of Monaco to ensure that the updates are ready.
|
|
59
|
+
standaloneServices_1.StandaloneServices.get(standaloneTheme_1.IStandaloneThemeService).onDidColorThemeChange(() => this.controller.applyStyles(this.computeStyles()));
|
|
60
|
+
window.addEventListener('resize', () => this.updateLayout());
|
|
61
|
+
}
|
|
62
|
+
setContextKey(key) {
|
|
63
|
+
if (key) {
|
|
64
|
+
standaloneServices_1.StandaloneServices.get(contextkey_1.IContextKeyService).createKey(key, undefined);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
createQuickWidget() {
|
|
68
|
+
return this.controller.createQuickWidget();
|
|
69
|
+
}
|
|
70
|
+
createQuickPick() {
|
|
71
|
+
return this.controller.createQuickPick();
|
|
72
|
+
}
|
|
73
|
+
createInputBox() {
|
|
74
|
+
return this.controller.createInputBox();
|
|
75
|
+
}
|
|
76
|
+
open(filter) {
|
|
77
|
+
this.quickAccess.show(filter);
|
|
78
|
+
setTimeout(() => {
|
|
79
|
+
this.quickInputList.focusNth(0);
|
|
80
|
+
}, 300);
|
|
81
|
+
}
|
|
82
|
+
input(options, token) {
|
|
83
|
+
return this.controller.input(options, token);
|
|
84
|
+
}
|
|
85
|
+
pick(picks, options, token) {
|
|
86
|
+
return this.controller.pick(picks, options, token);
|
|
87
|
+
}
|
|
88
|
+
hide() {
|
|
89
|
+
this.controller.hide();
|
|
90
|
+
}
|
|
91
|
+
focus() {
|
|
92
|
+
this.controller.focus();
|
|
93
|
+
}
|
|
94
|
+
toggle() {
|
|
95
|
+
this.controller.toggle();
|
|
96
|
+
}
|
|
97
|
+
applyStyles(styles) {
|
|
98
|
+
this.controller.applyStyles(styles);
|
|
99
|
+
}
|
|
100
|
+
layout(dimension, titleBarOffset) {
|
|
101
|
+
this.controller.layout(dimension, titleBarOffset);
|
|
102
|
+
}
|
|
103
|
+
navigate(next, quickNavigate) {
|
|
104
|
+
this.controller.navigate(next, quickNavigate);
|
|
105
|
+
}
|
|
106
|
+
dispose() {
|
|
107
|
+
this.controller.dispose();
|
|
108
|
+
}
|
|
109
|
+
async cancel() {
|
|
110
|
+
this.controller.cancel();
|
|
111
|
+
}
|
|
112
|
+
async back() {
|
|
113
|
+
this.controller.back();
|
|
114
|
+
}
|
|
115
|
+
async accept(keyMods) {
|
|
116
|
+
this.controller.accept(keyMods);
|
|
117
|
+
}
|
|
118
|
+
initContainer() {
|
|
119
|
+
const container = this.container = document.createElement('div');
|
|
120
|
+
container.id = 'quick-input-container';
|
|
121
|
+
document.body.appendChild(this.container);
|
|
122
|
+
}
|
|
123
|
+
initController() {
|
|
124
|
+
this.controller = new quickInputController_1.QuickInputController(this.getOptions(), standaloneServices_1.StandaloneServices.get(standaloneTheme_1.IStandaloneThemeService));
|
|
125
|
+
this.updateLayout();
|
|
126
|
+
}
|
|
127
|
+
updateLayout() {
|
|
128
|
+
// Initialize the layout using screen dimensions as monaco computes the actual sizing.
|
|
129
|
+
// https://github.com/microsoft/vscode/blob/6261075646f055b99068d3688932416f2346dd3b/src/vs/base/parts/quickinput/browser/quickInput.ts#L1799
|
|
130
|
+
this.controller.layout(this.getClientDimension(), 0);
|
|
131
|
+
}
|
|
132
|
+
getClientDimension() {
|
|
133
|
+
return { width: window.innerWidth, height: window.innerHeight };
|
|
134
|
+
}
|
|
135
|
+
getOptions() {
|
|
136
|
+
const options = {
|
|
137
|
+
idPrefix: 'quickInput_',
|
|
138
|
+
container: this.container,
|
|
139
|
+
styles: this.computeStyles(),
|
|
140
|
+
ignoreFocusOut: () => false,
|
|
141
|
+
backKeybindingLabel: () => undefined,
|
|
142
|
+
setContextKey: (id) => this.setContextKey(id),
|
|
143
|
+
returnFocus: () => this.container.focus(),
|
|
144
|
+
createList: (user, container, delegate, renderers, listOptions) => this.quickInputList = new listWidget_1.List(user, container, delegate, renderers, listOptions),
|
|
145
|
+
linkOpenerDelegate: () => {
|
|
146
|
+
// @monaco-uplift: not sure what to do here
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
return options;
|
|
150
|
+
}
|
|
151
|
+
// @monaco-uplift
|
|
152
|
+
// Keep the styles up to date with https://github.com/microsoft/vscode/blob/7888ff3a6b104e9e2e3d0f7890ca92dd0828215f/src/vs/platform/quickinput/browser/quickInput.ts#L171.
|
|
153
|
+
computeStyles() {
|
|
154
|
+
return {
|
|
155
|
+
widget: {
|
|
156
|
+
quickInputBackground: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.quickInputBackground),
|
|
157
|
+
quickInputForeground: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.quickInputForeground),
|
|
158
|
+
quickInputTitleBackground: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.quickInputTitleBackground),
|
|
159
|
+
widgetBorder: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.widgetBorder),
|
|
160
|
+
widgetShadow: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.widgetShadow),
|
|
161
|
+
},
|
|
162
|
+
inputBox: defaultStyles_1.defaultInputBoxStyles,
|
|
163
|
+
toggle: defaultStyles_1.defaultToggleStyles,
|
|
164
|
+
countBadge: defaultStyles_1.defaultCountBadgeStyles,
|
|
165
|
+
button: defaultStyles_1.defaultButtonStyles,
|
|
166
|
+
progressBar: defaultStyles_1.defaultProgressBarStyles,
|
|
167
|
+
keybindingLabel: defaultStyles_1.defaultKeybindingLabelStyles,
|
|
168
|
+
list: (0, defaultStyles_1.getListStyles)({
|
|
169
|
+
listBackground: colorRegistry_1.quickInputBackground,
|
|
170
|
+
listFocusBackground: colorRegistry_1.quickInputListFocusBackground,
|
|
171
|
+
listFocusForeground: colorRegistry_1.quickInputListFocusForeground,
|
|
172
|
+
// Look like focused when inactive.
|
|
173
|
+
listInactiveFocusForeground: colorRegistry_1.quickInputListFocusForeground,
|
|
174
|
+
listInactiveSelectionIconForeground: colorRegistry_1.quickInputListFocusIconForeground,
|
|
175
|
+
listInactiveFocusBackground: colorRegistry_1.quickInputListFocusBackground,
|
|
176
|
+
listFocusOutline: colorRegistry_1.activeContrastBorder,
|
|
177
|
+
listInactiveFocusOutline: colorRegistry_1.activeContrastBorder,
|
|
178
|
+
}),
|
|
179
|
+
pickerGroup: {
|
|
180
|
+
pickerGroupBorder: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.pickerGroupBorder),
|
|
181
|
+
pickerGroupForeground: (0, colorRegistry_1.asCssVariable)(colorRegistry_1.pickerGroupForeground),
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, inversify_1.inject)(browser_1.ApplicationShell),
|
|
188
|
+
__metadata("design:type", browser_1.ApplicationShell)
|
|
189
|
+
], MonacoQuickInputImplementation.prototype, "shell", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
(0, inversify_1.inject)(monaco_color_registry_1.MonacoColorRegistry),
|
|
192
|
+
__metadata("design:type", monaco_color_registry_1.MonacoColorRegistry)
|
|
193
|
+
], MonacoQuickInputImplementation.prototype, "colorRegistry", void 0);
|
|
194
|
+
__decorate([
|
|
195
|
+
(0, inversify_1.inject)(theming_1.ThemeService),
|
|
196
|
+
__metadata("design:type", theming_1.ThemeService)
|
|
197
|
+
], MonacoQuickInputImplementation.prototype, "themeService", void 0);
|
|
198
|
+
__decorate([
|
|
199
|
+
(0, inversify_1.postConstruct)(),
|
|
200
|
+
__metadata("design:type", Function),
|
|
201
|
+
__metadata("design:paramtypes", []),
|
|
202
|
+
__metadata("design:returntype", void 0)
|
|
203
|
+
], MonacoQuickInputImplementation.prototype, "init", null);
|
|
204
|
+
MonacoQuickInputImplementation = __decorate([
|
|
205
|
+
(0, inversify_1.injectable)()
|
|
206
|
+
], MonacoQuickInputImplementation);
|
|
207
|
+
exports.MonacoQuickInputImplementation = MonacoQuickInputImplementation;
|
|
208
|
+
let MonacoQuickInputService = class MonacoQuickInputService {
|
|
209
|
+
get backButton() {
|
|
210
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
211
|
+
return this.monacoService.backButton;
|
|
212
|
+
}
|
|
213
|
+
get onShow() { return this.monacoService.onShow; }
|
|
214
|
+
get onHide() { return this.monacoService.onHide; }
|
|
215
|
+
open(filter) {
|
|
216
|
+
this.monacoService.open(filter);
|
|
217
|
+
}
|
|
218
|
+
createInputBox() {
|
|
219
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
220
|
+
return this.monacoService.createInputBox();
|
|
221
|
+
}
|
|
222
|
+
input(options, token) {
|
|
223
|
+
let inputOptions;
|
|
224
|
+
if (options) {
|
|
225
|
+
const { validateInput, ...props } = options;
|
|
226
|
+
inputOptions = { ...props };
|
|
227
|
+
if (validateInput) {
|
|
228
|
+
inputOptions.validateInput = async (input) => validateInput(input);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return this.monacoService.input(inputOptions, token);
|
|
232
|
+
}
|
|
233
|
+
async pick(picks, options, token) {
|
|
234
|
+
return this.monacoService.pick(picks, options, token);
|
|
235
|
+
}
|
|
236
|
+
showQuickPick(items, options) {
|
|
237
|
+
return new Promise((resolve, reject) => {
|
|
238
|
+
var _a, _b, _c, _d;
|
|
239
|
+
const wrapped = this.createQuickPick();
|
|
240
|
+
wrapped.items = items;
|
|
241
|
+
if (options) {
|
|
242
|
+
wrapped.canSelectMany = !!options.canSelectMany;
|
|
243
|
+
wrapped.contextKey = options.contextKey;
|
|
244
|
+
wrapped.description = options.description;
|
|
245
|
+
wrapped.enabled = (_a = options.enabled) !== null && _a !== void 0 ? _a : true;
|
|
246
|
+
wrapped.ignoreFocusOut = !!options.ignoreFocusOut;
|
|
247
|
+
wrapped.matchOnDescription = (_b = options.matchOnDescription) !== null && _b !== void 0 ? _b : true;
|
|
248
|
+
wrapped.matchOnDetail = (_c = options.matchOnDetail) !== null && _c !== void 0 ? _c : true;
|
|
249
|
+
wrapped.keepScrollPosition = (_d = options.keepScrollPosition) !== null && _d !== void 0 ? _d : false;
|
|
250
|
+
wrapped.placeholder = options.placeholder;
|
|
251
|
+
wrapped.step = options.step;
|
|
252
|
+
wrapped.title = options.title;
|
|
253
|
+
wrapped.totalSteps = options.totalSteps;
|
|
254
|
+
if (options.activeItem) {
|
|
255
|
+
wrapped.activeItems = [options.activeItem];
|
|
256
|
+
}
|
|
257
|
+
wrapped.onDidAccept(() => {
|
|
258
|
+
if (options === null || options === void 0 ? void 0 : options.onDidAccept) {
|
|
259
|
+
options.onDidAccept();
|
|
260
|
+
}
|
|
261
|
+
wrapped.hide();
|
|
262
|
+
resolve(wrapped.selectedItems[0]);
|
|
263
|
+
});
|
|
264
|
+
wrapped.onDidHide(() => {
|
|
265
|
+
if (options.onDidHide) {
|
|
266
|
+
options.onDidHide();
|
|
267
|
+
}
|
|
268
|
+
;
|
|
269
|
+
wrapped.dispose();
|
|
270
|
+
setTimeout(() => resolve(undefined));
|
|
271
|
+
});
|
|
272
|
+
wrapped.onDidChangeValue((filter) => {
|
|
273
|
+
if (options.onDidChangeValue) {
|
|
274
|
+
options.onDidChangeValue(wrapped, filter);
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
wrapped.onDidChangeActive((activeItems) => {
|
|
278
|
+
if (options.onDidChangeActive) {
|
|
279
|
+
options.onDidChangeActive(wrapped, activeItems);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
wrapped.onDidTriggerButton((button) => {
|
|
283
|
+
if (options.onDidTriggerButton) {
|
|
284
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
285
|
+
options.onDidTriggerButton(button);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
wrapped.onDidTriggerItemButton((event) => {
|
|
289
|
+
if (options.onDidTriggerItemButton) {
|
|
290
|
+
// https://github.com/theia-ide/vscode/blob/standalone/0.23.x/src/vs/base/parts/quickinput/browser/quickInput.ts#L1387
|
|
291
|
+
options.onDidTriggerItemButton({
|
|
292
|
+
...event,
|
|
293
|
+
removeItem: () => {
|
|
294
|
+
wrapped.items = wrapped.items.filter(item => item !== event.item);
|
|
295
|
+
wrapped.activeItems = wrapped.activeItems.filter(item => item !== event.item);
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
wrapped.onDidChangeSelection((selectedItems) => {
|
|
301
|
+
if (options.onDidChangeSelection) {
|
|
302
|
+
options.onDidChangeSelection(wrapped, selectedItems);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
wrapped.show();
|
|
307
|
+
}).then(item => {
|
|
308
|
+
if (item === null || item === void 0 ? void 0 : item.execute) {
|
|
309
|
+
item.execute();
|
|
310
|
+
}
|
|
311
|
+
return item;
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
createQuickPick() {
|
|
315
|
+
const quickPick = this.monacoService.createQuickPick();
|
|
316
|
+
return this.wrapQuickPick(quickPick);
|
|
317
|
+
}
|
|
318
|
+
wrapQuickPick(wrapped) {
|
|
319
|
+
return new MonacoQuickPick(wrapped, this.keybindingRegistry);
|
|
320
|
+
}
|
|
321
|
+
convertItems(item) {
|
|
322
|
+
return new MonacoQuickPickItem(item, this.keybindingRegistry);
|
|
323
|
+
}
|
|
324
|
+
hide() {
|
|
325
|
+
return this.monacoService.hide();
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
__decorate([
|
|
329
|
+
(0, inversify_1.inject)(MonacoQuickInputImplementation),
|
|
330
|
+
__metadata("design:type", MonacoQuickInputImplementation)
|
|
331
|
+
], MonacoQuickInputService.prototype, "monacoService", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
(0, inversify_1.inject)(browser_1.KeybindingRegistry),
|
|
334
|
+
__metadata("design:type", browser_1.KeybindingRegistry)
|
|
335
|
+
], MonacoQuickInputService.prototype, "keybindingRegistry", void 0);
|
|
336
|
+
MonacoQuickInputService = __decorate([
|
|
337
|
+
(0, inversify_1.injectable)()
|
|
338
|
+
], MonacoQuickInputService);
|
|
339
|
+
exports.MonacoQuickInputService = MonacoQuickInputService;
|
|
340
|
+
class MonacoQuickInput {
|
|
341
|
+
constructor(wrapped) {
|
|
342
|
+
this.wrapped = wrapped;
|
|
343
|
+
}
|
|
344
|
+
get onDidHide() { return this.wrapped.onDidHide; }
|
|
345
|
+
get onDispose() { return this.wrapped.onDispose; }
|
|
346
|
+
get title() {
|
|
347
|
+
return this.wrapped.title;
|
|
348
|
+
}
|
|
349
|
+
set title(v) {
|
|
350
|
+
this.wrapped.title = v;
|
|
351
|
+
}
|
|
352
|
+
get description() {
|
|
353
|
+
return this.wrapped.description;
|
|
354
|
+
}
|
|
355
|
+
set description(v) {
|
|
356
|
+
this.wrapped.description = v;
|
|
357
|
+
}
|
|
358
|
+
get step() {
|
|
359
|
+
return this.wrapped.step;
|
|
360
|
+
}
|
|
361
|
+
set step(v) {
|
|
362
|
+
this.wrapped.step = v;
|
|
363
|
+
}
|
|
364
|
+
get enabled() {
|
|
365
|
+
return this.wrapped.enabled;
|
|
366
|
+
}
|
|
367
|
+
set enabled(v) {
|
|
368
|
+
this.wrapped.enabled = v;
|
|
369
|
+
}
|
|
370
|
+
get totalSteps() {
|
|
371
|
+
return this.wrapped.totalSteps;
|
|
372
|
+
}
|
|
373
|
+
set totalSteps(v) {
|
|
374
|
+
this.wrapped.totalSteps = v;
|
|
375
|
+
}
|
|
376
|
+
get contextKey() {
|
|
377
|
+
return this.wrapped.contextKey;
|
|
378
|
+
}
|
|
379
|
+
set contextKey(v) {
|
|
380
|
+
this.wrapped.contextKey = v;
|
|
381
|
+
}
|
|
382
|
+
get busy() {
|
|
383
|
+
return this.wrapped.busy;
|
|
384
|
+
}
|
|
385
|
+
set busy(v) {
|
|
386
|
+
this.wrapped.busy = v;
|
|
387
|
+
}
|
|
388
|
+
get ignoreFocusOut() {
|
|
389
|
+
return this.wrapped.ignoreFocusOut;
|
|
390
|
+
}
|
|
391
|
+
set ignoreFocusOut(v) {
|
|
392
|
+
this.wrapped.ignoreFocusOut = v;
|
|
393
|
+
}
|
|
394
|
+
show() {
|
|
395
|
+
this.wrapped.show();
|
|
396
|
+
}
|
|
397
|
+
hide() {
|
|
398
|
+
this.wrapped.hide();
|
|
399
|
+
}
|
|
400
|
+
dispose() {
|
|
401
|
+
this.wrapped.dispose();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
class MonacoQuickPick extends MonacoQuickInput {
|
|
405
|
+
constructor(wrapped, keybindingRegistry) {
|
|
406
|
+
super(wrapped);
|
|
407
|
+
this.wrapped = wrapped;
|
|
408
|
+
this.keybindingRegistry = keybindingRegistry;
|
|
409
|
+
this.onDidAccept = this.wrapped.onDidAccept;
|
|
410
|
+
this.onDidChangeValue = this.wrapped.onDidChangeValue;
|
|
411
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
412
|
+
this.onDidTriggerButton = this.wrapped.onDidTriggerButton;
|
|
413
|
+
this.onDidTriggerItemButton = core_1.Event.map(this.wrapped.onDidTriggerItemButton, (evt) => ({
|
|
414
|
+
item: evt.item.item,
|
|
415
|
+
button: evt.button
|
|
416
|
+
}));
|
|
417
|
+
this.onDidChangeActive = core_1.Event.map(this.wrapped.onDidChangeActive, (items) => items.map(item => item.item));
|
|
418
|
+
this.onDidChangeSelection = core_1.Event.map(this.wrapped.onDidChangeSelection, (items) => items.map(item => item.item));
|
|
419
|
+
}
|
|
420
|
+
get value() {
|
|
421
|
+
return this.wrapped.value;
|
|
422
|
+
}
|
|
423
|
+
;
|
|
424
|
+
set value(v) {
|
|
425
|
+
this.wrapped.value = v;
|
|
426
|
+
}
|
|
427
|
+
get placeholder() {
|
|
428
|
+
return this.wrapped.placeholder;
|
|
429
|
+
}
|
|
430
|
+
set placeholder(v) {
|
|
431
|
+
this.wrapped.placeholder = v;
|
|
432
|
+
}
|
|
433
|
+
get canSelectMany() {
|
|
434
|
+
return this.wrapped.canSelectMany;
|
|
435
|
+
}
|
|
436
|
+
set canSelectMany(v) {
|
|
437
|
+
this.wrapped.canSelectMany = v;
|
|
438
|
+
}
|
|
439
|
+
get matchOnDescription() {
|
|
440
|
+
return this.wrapped.matchOnDescription;
|
|
441
|
+
}
|
|
442
|
+
set matchOnDescription(v) {
|
|
443
|
+
this.wrapped.matchOnDescription = v;
|
|
444
|
+
}
|
|
445
|
+
get matchOnDetail() {
|
|
446
|
+
return this.wrapped.matchOnDetail;
|
|
447
|
+
}
|
|
448
|
+
set matchOnDetail(v) {
|
|
449
|
+
this.wrapped.matchOnDetail = v;
|
|
450
|
+
}
|
|
451
|
+
get keepScrollPosition() {
|
|
452
|
+
return this.wrapped.keepScrollPosition;
|
|
453
|
+
}
|
|
454
|
+
set keepScrollPosition(v) {
|
|
455
|
+
this.wrapped.keepScrollPosition = v;
|
|
456
|
+
}
|
|
457
|
+
get items() {
|
|
458
|
+
// need to cast because of vscode issue https://github.com/microsoft/vscode/issues/190584
|
|
459
|
+
return this.wrapped.items.map(item => {
|
|
460
|
+
if (item instanceof MonacoQuickPickItem) {
|
|
461
|
+
return item.item;
|
|
462
|
+
}
|
|
463
|
+
else {
|
|
464
|
+
return item;
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
}
|
|
468
|
+
set items(itemList) {
|
|
469
|
+
// We need to store and apply the currently selected active items.
|
|
470
|
+
// Since monaco compares these items by reference equality, creating new wrapped items will unmark any active items.
|
|
471
|
+
// Assigning the `activeItems` again will restore all active items even after the items array has changed.
|
|
472
|
+
// See also the `findMonacoItemReferences` method.
|
|
473
|
+
const active = this.activeItems;
|
|
474
|
+
this.wrapped.items = itemList.map(item => browser_1.QuickPickSeparator.is(item) ? item : new MonacoQuickPickItem(item, this.keybindingRegistry));
|
|
475
|
+
if (active.length !== 0) {
|
|
476
|
+
this.activeItems = active; // If this is done with an empty activeItems array, then it will undo first item focus on quick menus.
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
set activeItems(itemList) {
|
|
480
|
+
this.wrapped.activeItems = this.findMonacoItemReferences(this.wrapped.items, itemList);
|
|
481
|
+
}
|
|
482
|
+
get activeItems() {
|
|
483
|
+
return this.wrapped.activeItems.map(item => item.item);
|
|
484
|
+
}
|
|
485
|
+
set selectedItems(itemList) {
|
|
486
|
+
this.wrapped.selectedItems = this.findMonacoItemReferences(this.wrapped.items, itemList);
|
|
487
|
+
}
|
|
488
|
+
get selectedItems() {
|
|
489
|
+
return this.wrapped.selectedItems.map(item => item.item);
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* Monaco doesn't check for deep equality when setting the `activeItems` or `selectedItems`.
|
|
493
|
+
* Instead we have to find the references of the monaco wrappers that contain the selected/active items
|
|
494
|
+
*/
|
|
495
|
+
findMonacoItemReferences(source, items) {
|
|
496
|
+
const monacoReferences = [];
|
|
497
|
+
for (const item of items) {
|
|
498
|
+
for (const wrappedItem of source) {
|
|
499
|
+
if (wrappedItem instanceof MonacoQuickPickItem && wrappedItem.item === item) {
|
|
500
|
+
monacoReferences.push(wrappedItem);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return monacoReferences;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
class MonacoQuickPickItem {
|
|
508
|
+
constructor(item, kbRegistry) {
|
|
509
|
+
this.item = item;
|
|
510
|
+
this.type = item.type;
|
|
511
|
+
this.id = item.id;
|
|
512
|
+
this.label = item.label;
|
|
513
|
+
this.meta = item.meta;
|
|
514
|
+
this.ariaLabel = item.ariaLabel;
|
|
515
|
+
this.description = item.description;
|
|
516
|
+
this.detail = item.detail;
|
|
517
|
+
this.keybinding = item.keySequence ? new monaco_resolved_keybinding_1.MonacoResolvedKeybinding(item.keySequence, kbRegistry) : undefined;
|
|
518
|
+
this.iconClasses = item.iconClasses;
|
|
519
|
+
this.buttons = item.buttons;
|
|
520
|
+
this.alwaysShow = item.alwaysShow;
|
|
521
|
+
this.highlights = item.highlights;
|
|
522
|
+
}
|
|
523
|
+
accept() {
|
|
524
|
+
if (this.item.execute) {
|
|
525
|
+
this.item.execute();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
exports.MonacoQuickPickItem = MonacoQuickPickItem;
|
|
569
530
|
//# sourceMappingURL=monaco-quick-input-service.js.map
|