@codingame/monaco-vscode-view-common-service-override 4.5.1 → 5.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 +3 -3
- package/viewCommon.js +3 -6
- package/vscode/src/vs/base/browser/ui/grid/grid.js +12 -12
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +26 -26
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +4 -3
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +142 -221
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +49 -45
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +7 -30
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +67 -138
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +25 -38
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +26 -27
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +20 -34
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +7 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +216 -765
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +27 -42
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +24 -23
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +54 -19
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +122 -72
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +51 -54
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +44 -44
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +25 -26
- package/vscode/src/vs/workbench/browser/parts/sidebar/media/sidebarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +2 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +22 -22
- package/vscode/src/vs/workbench/browser/window.js +41 -92
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +41 -78
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +36 -27
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +14 -15
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +10 -11
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +1 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +25 -52
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +59 -88
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +18 -48
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +61 -150
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +15 -70
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +9 -20
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +14 -65
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +39 -113
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +13 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +1 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +35 -75
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +16 -37
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +41 -43
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +6 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +13 -11
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +24 -61
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +7 -6
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +37 -70
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -46
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +26 -27
- package/vscode/src/vs/workbench/contrib/webview/browser/overlayWebview.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +50 -52
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +5 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +18 -34
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +7 -10
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +13 -11
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewService.js +2 -2
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +79 -49
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +9 -7
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +45 -68
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +95 -98
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +34 -74
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +69 -67
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +52 -47
|
@@ -17,24 +17,33 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
17
17
|
import { Barrier } from 'vscode/vscode/vs/base/common/async';
|
|
18
18
|
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
19
19
|
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
20
|
+
import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
|
|
21
|
+
import { getZoomLevel } from 'vscode/vscode/vs/base/browser/browser';
|
|
20
22
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
23
|
|
|
22
24
|
var BrowserAuxiliaryWindowService_1;
|
|
25
|
+
const _moduleId = "vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService";
|
|
26
|
+
var AuxiliaryWindowMode;
|
|
27
|
+
( ((function(AuxiliaryWindowMode) {
|
|
28
|
+
AuxiliaryWindowMode[AuxiliaryWindowMode["Maximized"] = 0] = "Maximized";
|
|
29
|
+
AuxiliaryWindowMode[AuxiliaryWindowMode["Normal"] = 1] = "Normal";
|
|
30
|
+
AuxiliaryWindowMode[AuxiliaryWindowMode["Fullscreen"] = 2] = "Fullscreen";
|
|
31
|
+
})(AuxiliaryWindowMode || (AuxiliaryWindowMode = {}))));
|
|
23
32
|
let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
24
33
|
constructor(window, container, stylesHaveLoaded, configurationService, hostService, environmentService) {
|
|
25
34
|
super(window, undefined, hostService, environmentService);
|
|
26
35
|
this.window = window;
|
|
27
36
|
this.container = container;
|
|
28
37
|
this.configurationService = configurationService;
|
|
29
|
-
this._onWillLayout = this._register(( new Emitter()));
|
|
38
|
+
this._onWillLayout = this._register(( (new Emitter())));
|
|
30
39
|
this.onWillLayout = this._onWillLayout.event;
|
|
31
|
-
this._onDidLayout = this._register(( new Emitter()));
|
|
40
|
+
this._onDidLayout = this._register(( (new Emitter())));
|
|
32
41
|
this.onDidLayout = this._onDidLayout.event;
|
|
33
|
-
this._onBeforeUnload = this._register(( new Emitter()));
|
|
42
|
+
this._onBeforeUnload = this._register(( (new Emitter())));
|
|
34
43
|
this.onBeforeUnload = this._onBeforeUnload.event;
|
|
35
|
-
this._onUnload = this._register(( new Emitter()));
|
|
44
|
+
this._onUnload = this._register(( (new Emitter())));
|
|
36
45
|
this.onUnload = this._onUnload.event;
|
|
37
|
-
this._onWillDispose = this._register(( new Emitter()));
|
|
46
|
+
this._onWillDispose = this._register(( (new Emitter())));
|
|
38
47
|
this.onWillDispose = this._onWillDispose.event;
|
|
39
48
|
this.whenStylesHaveLoaded = stylesHaveLoaded.wait().then(() => undefined);
|
|
40
49
|
this.registerListeners();
|
|
@@ -83,8 +92,8 @@ let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
|
83
92
|
preventUnload(e) {
|
|
84
93
|
e.preventDefault();
|
|
85
94
|
e.returnValue = ( localizeWithPath(
|
|
86
|
-
|
|
87
|
-
|
|
95
|
+
_moduleId,
|
|
96
|
+
0,
|
|
88
97
|
"Changes that you made may not be saved. Please check press 'Cancel' and try again."
|
|
89
98
|
));
|
|
90
99
|
}
|
|
@@ -99,6 +108,17 @@ let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
|
99
108
|
this._onWillLayout.fire(dimension);
|
|
100
109
|
this._onDidLayout.fire(dimension);
|
|
101
110
|
}
|
|
111
|
+
createState() {
|
|
112
|
+
return {
|
|
113
|
+
bounds: {
|
|
114
|
+
x: this.window.screenX,
|
|
115
|
+
y: this.window.screenY,
|
|
116
|
+
width: this.window.outerWidth,
|
|
117
|
+
height: this.window.outerHeight
|
|
118
|
+
},
|
|
119
|
+
zoomLevel: getZoomLevel(this.window)
|
|
120
|
+
};
|
|
121
|
+
}
|
|
102
122
|
dispose() {
|
|
103
123
|
if (this._store.isDisposed) {
|
|
104
124
|
return;
|
|
@@ -107,11 +127,11 @@ let AuxiliaryWindow = class AuxiliaryWindow extends BaseWindow {
|
|
|
107
127
|
super.dispose();
|
|
108
128
|
}
|
|
109
129
|
};
|
|
110
|
-
AuxiliaryWindow = ( __decorate([
|
|
111
|
-
( __param(3, IConfigurationService)),
|
|
112
|
-
( __param(4, IHostService)),
|
|
113
|
-
( __param(5, IWorkbenchEnvironmentService))
|
|
114
|
-
], AuxiliaryWindow));
|
|
130
|
+
AuxiliaryWindow = ( (__decorate([
|
|
131
|
+
( (__param(3, IConfigurationService))),
|
|
132
|
+
( (__param(4, IHostService))),
|
|
133
|
+
( (__param(5, IWorkbenchEnvironmentService)))
|
|
134
|
+
], AuxiliaryWindow)));
|
|
115
135
|
let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends Disposable {
|
|
116
136
|
static { BrowserAuxiliaryWindowService_1 = this; }
|
|
117
137
|
static { this.DEFAULT_SIZE = { width: 800, height: 600 }; }
|
|
@@ -124,25 +144,25 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
124
144
|
this.telemetryService = telemetryService;
|
|
125
145
|
this.hostService = hostService;
|
|
126
146
|
this.environmentService = environmentService;
|
|
127
|
-
this._onDidOpenAuxiliaryWindow = this._register(( new Emitter()));
|
|
147
|
+
this._onDidOpenAuxiliaryWindow = this._register(( (new Emitter())));
|
|
128
148
|
this.onDidOpenAuxiliaryWindow = this._onDidOpenAuxiliaryWindow.event;
|
|
129
|
-
this.windows = ( new Map());
|
|
149
|
+
this.windows = ( (new Map()));
|
|
130
150
|
}
|
|
131
151
|
async open(options) {
|
|
132
152
|
mark('code/auxiliaryWindow/willOpen');
|
|
133
153
|
const targetWindow = await this.openWindow(options);
|
|
134
154
|
if (!targetWindow) {
|
|
135
|
-
throw new Error(localizeWithPath(
|
|
155
|
+
throw ( (new Error(localizeWithPath(_moduleId, 1, "Unable to open a new window."))));
|
|
136
156
|
}
|
|
137
157
|
const resolvedWindowId = await this.resolveWindowId(targetWindow);
|
|
138
158
|
ensureCodeWindow(targetWindow, resolvedWindowId);
|
|
139
|
-
const containerDisposables = ( new DisposableStore());
|
|
159
|
+
const containerDisposables = ( (new DisposableStore()));
|
|
140
160
|
const { container, stylesLoaded } = this.createContainer(targetWindow, containerDisposables, options);
|
|
141
161
|
const auxiliaryWindow = this.createAuxiliaryWindow(targetWindow, container, stylesLoaded);
|
|
142
|
-
const registryDisposables = ( new DisposableStore());
|
|
162
|
+
const registryDisposables = ( (new DisposableStore()));
|
|
143
163
|
this.windows.set(targetWindow.vscodeWindowId, auxiliaryWindow);
|
|
144
164
|
registryDisposables.add(toDisposable(() => this.windows.delete(targetWindow.vscodeWindowId)));
|
|
145
|
-
const eventDisposables = ( new DisposableStore());
|
|
165
|
+
const eventDisposables = ( (new DisposableStore()));
|
|
146
166
|
Event.once(auxiliaryWindow.onWillDispose)(() => {
|
|
147
167
|
targetWindow.close();
|
|
148
168
|
containerDisposables.dispose();
|
|
@@ -156,14 +176,16 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
156
176
|
return auxiliaryWindow;
|
|
157
177
|
}
|
|
158
178
|
createAuxiliaryWindow(targetWindow, container, stylesLoaded) {
|
|
159
|
-
return (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
179
|
+
return (
|
|
180
|
+
(new AuxiliaryWindow(
|
|
181
|
+
targetWindow,
|
|
182
|
+
container,
|
|
183
|
+
stylesLoaded,
|
|
184
|
+
this.configurationService,
|
|
185
|
+
this.hostService,
|
|
186
|
+
this.environmentService
|
|
187
|
+
))
|
|
188
|
+
);
|
|
167
189
|
}
|
|
168
190
|
async openWindow(options) {
|
|
169
191
|
const activeWindow = getActiveWindow();
|
|
@@ -181,34 +203,39 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
181
203
|
width,
|
|
182
204
|
height
|
|
183
205
|
};
|
|
184
|
-
if (newWindowBounds.x === activeWindowBounds.x && newWindowBounds.y === activeWindowBounds.y) {
|
|
206
|
+
if (!options?.bounds && newWindowBounds.x === activeWindowBounds.x && newWindowBounds.y === activeWindowBounds.y) {
|
|
185
207
|
newWindowBounds = {
|
|
186
208
|
...newWindowBounds,
|
|
187
209
|
x: newWindowBounds.x + 30,
|
|
188
210
|
y: newWindowBounds.y + 30
|
|
189
211
|
};
|
|
190
212
|
}
|
|
191
|
-
const
|
|
213
|
+
const features = coalesce([
|
|
214
|
+
'popup=yes',
|
|
215
|
+
`left=${newWindowBounds.x}`,
|
|
216
|
+
`top=${newWindowBounds.y}`,
|
|
217
|
+
`width=${newWindowBounds.width}`,
|
|
218
|
+
`height=${newWindowBounds.height}`,
|
|
219
|
+
options?.mode === AuxiliaryWindowMode.Maximized ? 'window-maximized=yes' : undefined,
|
|
220
|
+
options?.mode === AuxiliaryWindowMode.Fullscreen ? 'window-fullscreen=yes' : undefined
|
|
221
|
+
]);
|
|
222
|
+
const auxiliaryWindow = mainWindow.open('about:blank', undefined, features.join(','));
|
|
192
223
|
if (!auxiliaryWindow && isWeb) {
|
|
193
224
|
return (await this.dialogService.prompt({
|
|
194
225
|
type: Severity$1.Warning,
|
|
195
226
|
message: ( localizeWithPath(
|
|
196
|
-
|
|
197
|
-
|
|
227
|
+
_moduleId,
|
|
228
|
+
2,
|
|
198
229
|
"The browser interrupted the opening of a new window. Press 'Retry' to try again."
|
|
199
230
|
)),
|
|
200
231
|
detail: ( localizeWithPath(
|
|
201
|
-
|
|
202
|
-
|
|
232
|
+
_moduleId,
|
|
233
|
+
3,
|
|
203
234
|
"To avoid this problem in the future, please ensure to allow popups for this website."
|
|
204
235
|
)),
|
|
205
236
|
buttons: [
|
|
206
237
|
{
|
|
207
|
-
label: ( localizeWithPath(
|
|
208
|
-
'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService',
|
|
209
|
-
{ key: 'retry', comment: ['&& denotes a mnemonic'] },
|
|
210
|
-
"&&Retry"
|
|
211
|
-
)),
|
|
238
|
+
label: ( localizeWithPath(_moduleId, 4, "&&Retry")),
|
|
212
239
|
run: () => this.openWindow(options)
|
|
213
240
|
}
|
|
214
241
|
],
|
|
@@ -248,10 +275,10 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
248
275
|
}
|
|
249
276
|
applyCSS(auxiliaryWindow, disposables) {
|
|
250
277
|
mark('code/auxiliaryWindow/willApplyCSS');
|
|
251
|
-
const mapOriginalToClone = ( new Map());
|
|
252
|
-
const stylesLoaded = ( new Barrier());
|
|
278
|
+
const mapOriginalToClone = ( (new Map()));
|
|
279
|
+
const stylesLoaded = ( (new Barrier()));
|
|
253
280
|
stylesLoaded.wait().then(() => mark('code/auxiliaryWindow/didLoadCSSStyles'));
|
|
254
|
-
const pendingLinksDisposables = disposables.add(( new DisposableStore()));
|
|
281
|
+
const pendingLinksDisposables = disposables.add(( (new DisposableStore())));
|
|
255
282
|
let pendingLinksToSettle = 0;
|
|
256
283
|
function onLinkSettled() {
|
|
257
284
|
if (--pendingLinksToSettle === 0) {
|
|
@@ -328,14 +355,17 @@ let BrowserAuxiliaryWindowService = class BrowserAuxiliaryWindowService extends
|
|
|
328
355
|
mark('code/auxiliaryWindow/didApplyHTML');
|
|
329
356
|
return container;
|
|
330
357
|
}
|
|
358
|
+
getWindow(windowId) {
|
|
359
|
+
return this.windows.get(windowId);
|
|
360
|
+
}
|
|
331
361
|
};
|
|
332
|
-
BrowserAuxiliaryWindowService = BrowserAuxiliaryWindowService_1 = ( __decorate([
|
|
333
|
-
( __param(0, IWorkbenchLayoutService)),
|
|
334
|
-
( __param(1, IDialogService)),
|
|
335
|
-
( __param(2, IConfigurationService)),
|
|
336
|
-
( __param(3, ITelemetryService)),
|
|
337
|
-
( __param(4, IHostService)),
|
|
338
|
-
( __param(5, IWorkbenchEnvironmentService))
|
|
339
|
-
], BrowserAuxiliaryWindowService));
|
|
362
|
+
BrowserAuxiliaryWindowService = BrowserAuxiliaryWindowService_1 = ( (__decorate([
|
|
363
|
+
( (__param(0, IWorkbenchLayoutService))),
|
|
364
|
+
( (__param(1, IDialogService))),
|
|
365
|
+
( (__param(2, IConfigurationService))),
|
|
366
|
+
( (__param(3, ITelemetryService))),
|
|
367
|
+
( (__param(4, IHostService))),
|
|
368
|
+
( (__param(5, IWorkbenchEnvironmentService)))
|
|
369
|
+
], BrowserAuxiliaryWindowService)));
|
|
340
370
|
|
|
341
|
-
export { AuxiliaryWindow, BrowserAuxiliaryWindowService };
|
|
371
|
+
export { AuxiliaryWindow, AuxiliaryWindowMode, BrowserAuxiliaryWindowService };
|
|
@@ -51,7 +51,9 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
51
51
|
chain.unshift(`${tagName}${id}${classes}`);
|
|
52
52
|
el = el.parentElement;
|
|
53
53
|
}
|
|
54
|
-
throw new Error(
|
|
54
|
+
throw ( new Error(
|
|
55
|
+
`Active element not found. Current active element is '${chain.join(' > ')}'. Looking for ${selector}`
|
|
56
|
+
));
|
|
55
57
|
}
|
|
56
58
|
return true;
|
|
57
59
|
}
|
|
@@ -99,7 +101,7 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
99
101
|
async typeInEditor(selector, text) {
|
|
100
102
|
const element = mainWindow.document.querySelector(selector);
|
|
101
103
|
if (!element) {
|
|
102
|
-
throw new Error(`Editor not found: ${selector}`);
|
|
104
|
+
throw ( new Error(`Editor not found: ${selector}`));
|
|
103
105
|
}
|
|
104
106
|
const textarea = element;
|
|
105
107
|
const start = textarea.selectionStart;
|
|
@@ -114,11 +116,11 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
114
116
|
async getTerminalBuffer(selector) {
|
|
115
117
|
const element = mainWindow.document.querySelector(selector);
|
|
116
118
|
if (!element) {
|
|
117
|
-
throw new Error(`Terminal not found: ${selector}`);
|
|
119
|
+
throw ( new Error(`Terminal not found: ${selector}`));
|
|
118
120
|
}
|
|
119
121
|
const xterm = element.xterm;
|
|
120
122
|
if (!xterm) {
|
|
121
|
-
throw new Error(`Xterm not found: ${selector}`);
|
|
123
|
+
throw ( new Error(`Xterm not found: ${selector}`));
|
|
122
124
|
}
|
|
123
125
|
const lines = [];
|
|
124
126
|
for (let i = 0; i < xterm.buffer.active.length; i++) {
|
|
@@ -129,13 +131,13 @@ let BrowserWindowDriver = class BrowserWindowDriver {
|
|
|
129
131
|
async writeInTerminal(selector, text) {
|
|
130
132
|
const element = mainWindow.document.querySelector(selector);
|
|
131
133
|
if (!element) {
|
|
132
|
-
throw new Error(`Element not found: ${selector}`);
|
|
134
|
+
throw ( new Error(`Element not found: ${selector}`));
|
|
133
135
|
}
|
|
134
136
|
const xterm = element.xterm;
|
|
135
137
|
if (!xterm) {
|
|
136
|
-
throw new Error(`Xterm not found: ${selector}`);
|
|
138
|
+
throw ( new Error(`Xterm not found: ${selector}`));
|
|
137
139
|
}
|
|
138
|
-
xterm.
|
|
140
|
+
xterm.input(text);
|
|
139
141
|
}
|
|
140
142
|
getLocaleInfo() {
|
|
141
143
|
return Promise.resolve({
|
|
@@ -25,6 +25,7 @@ import { PauseableEmitter } from 'vscode/vscode/vs/base/common/event';
|
|
|
25
25
|
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
26
26
|
|
|
27
27
|
var EditorResolverService_1;
|
|
28
|
+
const _moduleId = "vs/workbench/services/editor/browser/editorResolverService";
|
|
28
29
|
let EditorResolverService = class EditorResolverService extends Disposable {
|
|
29
30
|
static { EditorResolverService_1 = this; }
|
|
30
31
|
static { this.configureDefaultID = 'promptOpenWith.configureDefault'; }
|
|
@@ -41,14 +42,14 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
41
42
|
this.storageService = storageService;
|
|
42
43
|
this.extensionService = extensionService;
|
|
43
44
|
this.logService = logService;
|
|
44
|
-
this._onDidChangeEditorRegistrations = this._register(( new PauseableEmitter()));
|
|
45
|
+
this._onDidChangeEditorRegistrations = this._register(( (new PauseableEmitter())));
|
|
45
46
|
this.onDidChangeEditorRegistrations = this._onDidChangeEditorRegistrations.event;
|
|
46
|
-
this._editors = ( new Map());
|
|
47
|
-
this._flattenedEditors = ( new Map());
|
|
47
|
+
this._editors = ( (new Map()));
|
|
48
|
+
this._flattenedEditors = ( (new Map()));
|
|
48
49
|
this._shouldReFlattenEditors = true;
|
|
49
|
-
this.cache = ( new Set(
|
|
50
|
+
this.cache = ( (new Set(
|
|
50
51
|
JSON.parse(this.storageService.get(EditorResolverService_1.cacheStorageID, 0 , JSON.stringify([])))
|
|
51
|
-
));
|
|
52
|
+
)));
|
|
52
53
|
this.storageService.remove(EditorResolverService_1.cacheStorageID, 0 );
|
|
53
54
|
this._register(this.storageService.onWillSaveState(() => {
|
|
54
55
|
this.cacheEditors();
|
|
@@ -93,7 +94,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
93
94
|
await this.extensionService.whenInstalledExtensionsRegistered();
|
|
94
95
|
}
|
|
95
96
|
if (resource === undefined) {
|
|
96
|
-
resource = ( URI.from({ scheme: Schemas.untitled }));
|
|
97
|
+
resource = ( (URI.from({ scheme: Schemas.untitled })));
|
|
97
98
|
}
|
|
98
99
|
else if (resource.scheme === undefined || resource === null) {
|
|
99
100
|
return 2 ;
|
|
@@ -120,7 +121,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
120
121
|
if (isResourceDiffEditorInput(untypedEditor) && untypedEditor.options?.override === undefined) {
|
|
121
122
|
let resource2 = EditorResourceAccessor.getCanonicalUri(untypedEditor, { supportSideBySide: SideBySideEditor.SECONDARY });
|
|
122
123
|
if (!resource2) {
|
|
123
|
-
resource2 = ( URI.from({ scheme: Schemas.untitled }));
|
|
124
|
+
resource2 = ( (URI.from({ scheme: Schemas.untitled })));
|
|
124
125
|
}
|
|
125
126
|
const { editor: selectedEditor2 } = this.getEditor(resource2, undefined);
|
|
126
127
|
if (!selectedEditor2 || selectedEditor.editorInfo.id !== selectedEditor2.editorInfo.id) {
|
|
@@ -176,7 +177,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
176
177
|
registerEditor(globPattern, editorInfo, options, editorFactoryObject) {
|
|
177
178
|
let registeredEditor = this._editors.get(globPattern);
|
|
178
179
|
if (registeredEditor === undefined) {
|
|
179
|
-
registeredEditor = ( new Map());
|
|
180
|
+
registeredEditor = ( (new Map()));
|
|
180
181
|
this._editors.set(globPattern, registeredEditor);
|
|
181
182
|
}
|
|
182
183
|
let editorsWithId = registeredEditor.get(editorInfo.id);
|
|
@@ -234,10 +235,10 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
234
235
|
return this._flattenedEditors;
|
|
235
236
|
}
|
|
236
237
|
this._shouldReFlattenEditors = false;
|
|
237
|
-
const editors = ( new Map());
|
|
238
|
+
const editors = ( (new Map()));
|
|
238
239
|
for (const [glob, value] of this._editors) {
|
|
239
240
|
const registeredEditors = [];
|
|
240
|
-
for (const editors of ( value.values())) {
|
|
241
|
+
for (const editors of ( (value.values()))) {
|
|
241
242
|
let registeredEditor = undefined;
|
|
242
243
|
for (const editor of editors) {
|
|
243
244
|
if (!registeredEditor) {
|
|
@@ -260,7 +261,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
260
261
|
return editors;
|
|
261
262
|
}
|
|
262
263
|
get _registeredEditors() {
|
|
263
|
-
return flatten(Array.from(( this._flattenedEditors.values())));
|
|
264
|
+
return flatten(Array.from(( (this._flattenedEditors.values()))));
|
|
264
265
|
}
|
|
265
266
|
updateUserAssociations(globPattern, editorID) {
|
|
266
267
|
const newAssociation = { viewType: editorID, filenamePattern: globPattern };
|
|
@@ -298,9 +299,11 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
298
299
|
if (editors.find(e => e.editorInfo.priority === RegisteredEditorPriority.exclusive)) {
|
|
299
300
|
return [];
|
|
300
301
|
}
|
|
301
|
-
return (
|
|
302
|
+
return (
|
|
303
|
+
(editors.map(editor => editor.editorInfo))
|
|
304
|
+
);
|
|
302
305
|
}
|
|
303
|
-
return distinct(( this._registeredEditors.map(editor => editor.editorInfo)), editor => editor.id);
|
|
306
|
+
return distinct(( (this._registeredEditors.map(editor => editor.editorInfo))), editor => editor.id);
|
|
304
307
|
}
|
|
305
308
|
getEditor(resource, editorId) {
|
|
306
309
|
const findMatchingEditor = (editors, viewType) => {
|
|
@@ -369,7 +372,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
369
372
|
return { editor: inputWithOptions.editor, options: inputWithOptions.options ?? options };
|
|
370
373
|
}
|
|
371
374
|
if (isResourceSideBySideEditorInput(editor)) {
|
|
372
|
-
throw new Error(`Untyped side by side editor input not supported here.`);
|
|
375
|
+
throw ( (new Error(`Untyped side by side editor input not supported here.`)));
|
|
373
376
|
}
|
|
374
377
|
if (isUntitledResourceEditorInput(editor)) {
|
|
375
378
|
if (!selectedEditor.editorFactoryObject.createUntitledEditorInput) {
|
|
@@ -379,7 +382,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
379
382
|
return { editor: inputWithOptions.editor, options: inputWithOptions.options ?? options };
|
|
380
383
|
}
|
|
381
384
|
if (resource === undefined) {
|
|
382
|
-
throw new Error(`Undefined resource on non untitled editor input.`);
|
|
385
|
+
throw ( (new Error(`Undefined resource on non untitled editor input.`)));
|
|
383
386
|
}
|
|
384
387
|
const singleEditorPerResource = typeof selectedEditor.options?.singlePerResource === 'function' ? selectedEditor.options.singlePerResource() : selectedEditor.options?.singlePerResource;
|
|
385
388
|
if (singleEditorPerResource) {
|
|
@@ -447,15 +450,11 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
447
450
|
return;
|
|
448
451
|
}
|
|
449
452
|
const handle = this.notificationService.prompt(Severity$1.Warning, ( localizeWithPath(
|
|
450
|
-
|
|
451
|
-
|
|
453
|
+
_moduleId,
|
|
454
|
+
0,
|
|
452
455
|
'There are multiple default editors available for the resource.'
|
|
453
456
|
)), [{
|
|
454
|
-
label: ( localizeWithPath(
|
|
455
|
-
'vs/workbench/services/editor/browser/editorResolverService',
|
|
456
|
-
'editorResolver.configureDefault',
|
|
457
|
-
'Configure Default'
|
|
458
|
-
)),
|
|
457
|
+
label: ( localizeWithPath(_moduleId, 1, 'Configure Default')),
|
|
459
458
|
run: async () => {
|
|
460
459
|
const picked = await this.doPickEditor(untypedInput, true);
|
|
461
460
|
if (!picked) {
|
|
@@ -476,12 +475,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
476
475
|
}
|
|
477
476
|
},
|
|
478
477
|
{
|
|
479
|
-
label: ( localizeWithPath(
|
|
480
|
-
'vs/workbench/services/editor/browser/editorResolverService',
|
|
481
|
-
'editorResolver.keepDefault',
|
|
482
|
-
'Keep {0}',
|
|
483
|
-
editorName
|
|
484
|
-
)),
|
|
478
|
+
label: ( localizeWithPath(_moduleId, 2, 'Keep {0}', editorName)),
|
|
485
479
|
run: writeCurrentEditorsToStorage
|
|
486
480
|
}
|
|
487
481
|
]);
|
|
@@ -507,21 +501,9 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
507
501
|
}
|
|
508
502
|
});
|
|
509
503
|
const quickPickEntries = [];
|
|
510
|
-
const currentlyActiveLabel = ( localizeWithPath(
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
"Active"
|
|
514
|
-
));
|
|
515
|
-
const currentDefaultLabel = ( localizeWithPath(
|
|
516
|
-
'vs/workbench/services/editor/browser/editorResolverService',
|
|
517
|
-
'promptOpenWith.currentDefault',
|
|
518
|
-
"Default"
|
|
519
|
-
));
|
|
520
|
-
const currentDefaultAndActiveLabel = ( localizeWithPath(
|
|
521
|
-
'vs/workbench/services/editor/browser/editorResolverService',
|
|
522
|
-
'promptOpenWith.currentDefaultAndActive',
|
|
523
|
-
"Active and Default"
|
|
524
|
-
));
|
|
504
|
+
const currentlyActiveLabel = ( localizeWithPath(_moduleId, 3, "Active"));
|
|
505
|
+
const currentDefaultLabel = ( localizeWithPath(_moduleId, 4, "Default"));
|
|
506
|
+
const currentDefaultAndActiveLabel = ( localizeWithPath(_moduleId, 5, "Active and Default"));
|
|
525
507
|
let defaultViewType = defaultSetting;
|
|
526
508
|
if (!defaultViewType && registeredEditors.length > 2 && registeredEditors[1]?.editorInfo.priority !== RegisteredEditorPriority.option) {
|
|
527
509
|
defaultViewType = registeredEditors[1]?.editorInfo.id;
|
|
@@ -547,8 +529,8 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
547
529
|
const configureDefaultEntry = {
|
|
548
530
|
id: EditorResolverService_1.configureDefaultID,
|
|
549
531
|
label: ( localizeWithPath(
|
|
550
|
-
|
|
551
|
-
|
|
532
|
+
_moduleId,
|
|
533
|
+
6,
|
|
552
534
|
"Configure default editor for '{0}'...",
|
|
553
535
|
`*${extname(resource)}`
|
|
554
536
|
)),
|
|
@@ -560,23 +542,18 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
560
542
|
async doPickEditor(editor, showDefaultPicker) {
|
|
561
543
|
let resource = EditorResourceAccessor.getOriginalUri(editor, { supportSideBySide: SideBySideEditor.PRIMARY });
|
|
562
544
|
if (resource === undefined) {
|
|
563
|
-
resource = ( URI.from({ scheme: Schemas.untitled }));
|
|
545
|
+
resource = ( (URI.from({ scheme: Schemas.untitled })));
|
|
564
546
|
}
|
|
565
547
|
const editorPicks = this.mapEditorsToQuickPickEntry(resource, showDefaultPicker);
|
|
566
548
|
const editorPicker = this.quickInputService.createQuickPick();
|
|
567
549
|
const placeHolderMessage = showDefaultPicker ?
|
|
568
550
|
( localizeWithPath(
|
|
569
|
-
|
|
570
|
-
|
|
551
|
+
_moduleId,
|
|
552
|
+
7,
|
|
571
553
|
"Select new default editor for '{0}'",
|
|
572
554
|
`*${extname(resource)}`
|
|
573
555
|
)) :
|
|
574
|
-
( localizeWithPath(
|
|
575
|
-
'vs/workbench/services/editor/browser/editorResolverService',
|
|
576
|
-
'promptOpenWith.placeHolder',
|
|
577
|
-
"Select editor for '{0}'",
|
|
578
|
-
basename(resource)
|
|
579
|
-
));
|
|
556
|
+
( localizeWithPath(_moduleId, 8, "Select editor for '{0}'", basename(resource)));
|
|
580
557
|
editorPicker.placeholder = placeHolderMessage;
|
|
581
558
|
editorPicker.canAcceptInBackground = true;
|
|
582
559
|
editorPicker.items = editorPicks;
|
|
@@ -584,7 +561,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
584
561
|
if (firstItem) {
|
|
585
562
|
editorPicker.selectedItems = [firstItem];
|
|
586
563
|
}
|
|
587
|
-
const picked = await ( new Promise(resolve => {
|
|
564
|
+
const picked = await ( (new Promise(resolve => {
|
|
588
565
|
editorPicker.onDidAccept(e => {
|
|
589
566
|
let result = undefined;
|
|
590
567
|
if (editorPicker.selectedItems.length === 1) {
|
|
@@ -607,7 +584,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
607
584
|
}
|
|
608
585
|
});
|
|
609
586
|
editorPicker.show();
|
|
610
|
-
}));
|
|
587
|
+
})));
|
|
611
588
|
editorPicker.dispose();
|
|
612
589
|
if (picked) {
|
|
613
590
|
if (picked.item.id === EditorResolverService_1.configureDefaultID) {
|
|
@@ -628,7 +605,7 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
628
605
|
}
|
|
629
606
|
}
|
|
630
607
|
cacheEditors() {
|
|
631
|
-
const cacheStorage = ( new Set());
|
|
608
|
+
const cacheStorage = ( (new Set()));
|
|
632
609
|
for (const [globPattern, contribPoint] of this._flattenedEditors) {
|
|
633
610
|
const nonOptional = !!contribPoint.find(c => c.editorInfo.priority !== RegisteredEditorPriority.option && c.editorInfo.id !== DEFAULT_EDITOR_ASSOCIATION.id);
|
|
634
611
|
if (!nonOptional) {
|
|
@@ -661,16 +638,16 @@ let EditorResolverService = class EditorResolverService extends Disposable {
|
|
|
661
638
|
return false;
|
|
662
639
|
}
|
|
663
640
|
};
|
|
664
|
-
EditorResolverService = EditorResolverService_1 = ( __decorate([
|
|
665
|
-
( __param(0, IEditorGroupsService)),
|
|
666
|
-
( __param(1, IInstantiationService)),
|
|
667
|
-
( __param(2, IConfigurationService)),
|
|
668
|
-
( __param(3, IQuickInputService)),
|
|
669
|
-
( __param(4, INotificationService)),
|
|
670
|
-
( __param(5, ITelemetryService)),
|
|
671
|
-
( __param(6, IStorageService)),
|
|
672
|
-
( __param(7, IExtensionService)),
|
|
673
|
-
( __param(8, ILogService))
|
|
674
|
-
], EditorResolverService));
|
|
641
|
+
EditorResolverService = EditorResolverService_1 = ( (__decorate([
|
|
642
|
+
( (__param(0, IEditorGroupsService))),
|
|
643
|
+
( (__param(1, IInstantiationService))),
|
|
644
|
+
( (__param(2, IConfigurationService))),
|
|
645
|
+
( (__param(3, IQuickInputService))),
|
|
646
|
+
( (__param(4, INotificationService))),
|
|
647
|
+
( (__param(5, ITelemetryService))),
|
|
648
|
+
( (__param(6, IStorageService))),
|
|
649
|
+
( (__param(7, IExtensionService))),
|
|
650
|
+
( (__param(8, ILogService)))
|
|
651
|
+
], EditorResolverService)));
|
|
675
652
|
|
|
676
653
|
export { EditorResolverService };
|