@codingame/monaco-vscode-view-common-service-override 5.3.0 → 6.0.1
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 +1 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +2 -1
- package/vscode/src/vs/base/browser/ui/grid/grid.js +34 -24
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +35 -34
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +9 -60
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +119 -79
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +76 -64
- package/vscode/src/vs/workbench/browser/media/style.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +51 -71
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -18
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +11 -8
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +8 -7
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +112 -107
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +36 -30
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +75 -69
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +143 -25
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +20 -16
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +13 -11
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +5 -4
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +8 -5
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +9 -6
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +51 -37
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +28 -25
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +2 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +34 -23
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +7 -1
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +3 -2
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +1 -0
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +17 -15
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +9 -8
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +11 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +24 -23
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +3 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +5 -4
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +2 -1
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +23 -13
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +5 -5
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewService.js +8 -6
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +10 -8
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -2
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +4 -3
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +1 -0
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +21 -19
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +73 -63
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +19 -15
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +1 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +23 -18
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +20 -14
- package/vscode/src/vs/base/browser/deviceAccess.js +0 -61
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +0 -13
- package/vscode/src/vs/workbench/browser/window.js +0 -330
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +0 -371
- package/vscode/src/vs/workbench/services/driver/browser/driver.js +0 -188
|
@@ -1,330 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import { setFullscreen, isSafari } from 'vscode/vscode/vs/base/browser/browser';
|
|
3
|
-
import { getWindowsCount, getWindows, getWindow, getActiveWindow, getWindowById, addDisposableListener, EventType, EventHelper, windowOpenWithSuccess, windowOpenPopup, windowOpenNoOpener } from 'vscode/vscode/vs/base/browser/dom';
|
|
4
|
-
import { DomEmitter } from 'vscode/vscode/vs/base/browser/event';
|
|
5
|
-
import { requestUsbDevice, requestSerialPort, requestHidDevice } from '../../base/browser/deviceAccess.js';
|
|
6
|
-
import { timeout } from 'vscode/vscode/vs/base/common/async';
|
|
7
|
-
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
8
|
-
import { Disposable, dispose, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
9
|
-
import { matchesScheme, Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
10
|
-
import { isMacintosh, isIOS } from 'vscode/vscode/vs/base/common/platform';
|
|
11
|
-
import Severity$1 from 'vscode/vscode/vs/base/common/severity';
|
|
12
|
-
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
13
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
14
|
-
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
15
|
-
import { IDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
16
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
17
|
-
import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
|
|
18
|
-
import { IOpenerService } from 'vscode/vscode/vs/platform/opener/common/opener.service';
|
|
19
|
-
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service';
|
|
20
|
-
import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
21
|
-
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
22
|
-
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
23
|
-
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
|
|
24
|
-
import { registerWindowDriver } from '../services/driver/browser/driver.js';
|
|
25
|
-
import { isAuxiliaryWindow, mainWindow } from 'vscode/vscode/vs/base/browser/window';
|
|
26
|
-
import { createSingleCallFunction } from 'vscode/vscode/vs/base/common/functional';
|
|
27
|
-
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
28
|
-
import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
29
|
-
|
|
30
|
-
var BaseWindow_1;
|
|
31
|
-
const _moduleId = "vs/workbench/browser/window";
|
|
32
|
-
let BaseWindow = class BaseWindow extends Disposable {
|
|
33
|
-
static { BaseWindow_1 = this; }
|
|
34
|
-
static { this.TIMEOUT_HANDLES = Number.MIN_SAFE_INTEGER; }
|
|
35
|
-
static { this.TIMEOUT_DISPOSABLES = ( (new Map())); }
|
|
36
|
-
constructor(targetWindow, dom = { getWindowsCount, getWindows }, hostService, environmentService) {
|
|
37
|
-
super();
|
|
38
|
-
this.hostService = hostService;
|
|
39
|
-
this.environmentService = environmentService;
|
|
40
|
-
this.enableWindowFocusOnElementFocus(targetWindow);
|
|
41
|
-
this.enableMultiWindowAwareTimeout(targetWindow, dom);
|
|
42
|
-
this.registerFullScreenListeners(targetWindow.vscodeWindowId);
|
|
43
|
-
}
|
|
44
|
-
enableWindowFocusOnElementFocus(targetWindow) {
|
|
45
|
-
const originalFocus = targetWindow.HTMLElement.prototype.focus;
|
|
46
|
-
const that = this;
|
|
47
|
-
targetWindow.HTMLElement.prototype.focus = function (options) {
|
|
48
|
-
that.onElementFocus(getWindow(this));
|
|
49
|
-
originalFocus.apply(this, [options]);
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
onElementFocus(targetWindow) {
|
|
53
|
-
const activeWindow = getActiveWindow();
|
|
54
|
-
if (activeWindow !== targetWindow && activeWindow.document.hasFocus()) {
|
|
55
|
-
targetWindow.focus();
|
|
56
|
-
if (!this.environmentService.extensionTestsLocationURI &&
|
|
57
|
-
!targetWindow.document.hasFocus()) {
|
|
58
|
-
this.hostService.focus(targetWindow);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
enableMultiWindowAwareTimeout(targetWindow, dom = { getWindowsCount, getWindows }) {
|
|
63
|
-
const originalSetTimeout = targetWindow.setTimeout;
|
|
64
|
-
Object.defineProperty(targetWindow, 'vscodeOriginalSetTimeout', { get: () => originalSetTimeout });
|
|
65
|
-
const originalClearTimeout = targetWindow.clearTimeout;
|
|
66
|
-
Object.defineProperty(targetWindow, 'vscodeOriginalClearTimeout', { get: () => originalClearTimeout });
|
|
67
|
-
targetWindow.setTimeout = function (handler, timeout = 0, ...args) {
|
|
68
|
-
if (dom.getWindowsCount() === 1 || typeof handler === 'string' || timeout === 0 ) {
|
|
69
|
-
return originalSetTimeout.apply(this, [handler, timeout, ...args]);
|
|
70
|
-
}
|
|
71
|
-
const timeoutDisposables = ( (new Set()));
|
|
72
|
-
const timeoutHandle = BaseWindow_1.TIMEOUT_HANDLES++;
|
|
73
|
-
BaseWindow_1.TIMEOUT_DISPOSABLES.set(timeoutHandle, timeoutDisposables);
|
|
74
|
-
const handlerFn = createSingleCallFunction(handler, () => {
|
|
75
|
-
dispose(timeoutDisposables);
|
|
76
|
-
BaseWindow_1.TIMEOUT_DISPOSABLES.delete(timeoutHandle);
|
|
77
|
-
});
|
|
78
|
-
for (const { window, disposables } of dom.getWindows()) {
|
|
79
|
-
if (isAuxiliaryWindow(window) && window.document.visibilityState === 'hidden') {
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
const handle = window.vscodeOriginalSetTimeout.apply(this, [handlerFn, timeout, ...args]);
|
|
83
|
-
const timeoutDisposable = toDisposable(() => {
|
|
84
|
-
window.vscodeOriginalClearTimeout(handle);
|
|
85
|
-
timeoutDisposables.delete(timeoutDisposable);
|
|
86
|
-
});
|
|
87
|
-
disposables.add(timeoutDisposable);
|
|
88
|
-
timeoutDisposables.add(timeoutDisposable);
|
|
89
|
-
}
|
|
90
|
-
return timeoutHandle;
|
|
91
|
-
};
|
|
92
|
-
targetWindow.clearTimeout = function (timeoutHandle) {
|
|
93
|
-
const timeoutDisposables = typeof timeoutHandle === 'number' ? BaseWindow_1.TIMEOUT_DISPOSABLES.get(timeoutHandle) : undefined;
|
|
94
|
-
if (timeoutDisposables) {
|
|
95
|
-
dispose(timeoutDisposables);
|
|
96
|
-
BaseWindow_1.TIMEOUT_DISPOSABLES.delete(timeoutHandle);
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
originalClearTimeout.apply(this, [timeoutHandle]);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
registerFullScreenListeners(targetWindowId) {
|
|
104
|
-
this._register(this.hostService.onDidChangeFullScreen(({ windowId, fullscreen }) => {
|
|
105
|
-
if (windowId === targetWindowId) {
|
|
106
|
-
const targetWindow = getWindowById(targetWindowId);
|
|
107
|
-
if (targetWindow) {
|
|
108
|
-
setFullscreen(fullscreen, targetWindow.window);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
static async confirmOnShutdown(accessor, reason) {
|
|
114
|
-
const dialogService = accessor.get(IDialogService);
|
|
115
|
-
const configurationService = accessor.get(IConfigurationService);
|
|
116
|
-
const message = reason === 2 ?
|
|
117
|
-
(isMacintosh ? ( localizeWithPath(_moduleId, 0, "Are you sure you want to quit?")) : ( localizeWithPath(_moduleId, 1, "Are you sure you want to exit?"))) :
|
|
118
|
-
( localizeWithPath(_moduleId, 2, "Are you sure you want to close the window?"));
|
|
119
|
-
const primaryButton = reason === 2 ?
|
|
120
|
-
(isMacintosh ? ( localizeWithPath(_moduleId, 3, "&&Quit")) : ( localizeWithPath(_moduleId, 4, "&&Exit"))) :
|
|
121
|
-
( localizeWithPath(_moduleId, 5, "&&Close Window"));
|
|
122
|
-
const res = await dialogService.confirm({
|
|
123
|
-
message,
|
|
124
|
-
primaryButton,
|
|
125
|
-
checkbox: {
|
|
126
|
-
label: ( localizeWithPath(_moduleId, 6, "Do not ask me again"))
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
if (res.confirmed && res.checkboxChecked) {
|
|
130
|
-
await configurationService.updateValue('window.confirmBeforeClose', 'never');
|
|
131
|
-
}
|
|
132
|
-
return res.confirmed;
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
BaseWindow = BaseWindow_1 = ( (__decorate([
|
|
136
|
-
( (__param(2, IHostService))),
|
|
137
|
-
( (__param(3, IWorkbenchEnvironmentService)))
|
|
138
|
-
], BaseWindow)));
|
|
139
|
-
let BrowserWindow = class BrowserWindow extends BaseWindow {
|
|
140
|
-
constructor(openerService, lifecycleService, dialogService, labelService, productService, browserEnvironmentService, layoutService, instantiationService, hostService) {
|
|
141
|
-
super(mainWindow, undefined, hostService, browserEnvironmentService);
|
|
142
|
-
this.openerService = openerService;
|
|
143
|
-
this.lifecycleService = lifecycleService;
|
|
144
|
-
this.dialogService = dialogService;
|
|
145
|
-
this.labelService = labelService;
|
|
146
|
-
this.productService = productService;
|
|
147
|
-
this.browserEnvironmentService = browserEnvironmentService;
|
|
148
|
-
this.layoutService = layoutService;
|
|
149
|
-
this.instantiationService = instantiationService;
|
|
150
|
-
this.registerListeners();
|
|
151
|
-
this.create();
|
|
152
|
-
}
|
|
153
|
-
registerListeners() {
|
|
154
|
-
this._register(this.lifecycleService.onWillShutdown(() => this.onWillShutdown()));
|
|
155
|
-
const viewport = isIOS && mainWindow.visualViewport ? mainWindow.visualViewport : mainWindow ;
|
|
156
|
-
this._register(addDisposableListener(viewport, EventType.RESIZE, () => {
|
|
157
|
-
this.layoutService.layout();
|
|
158
|
-
if (isIOS) {
|
|
159
|
-
mainWindow.scrollTo(0, 0);
|
|
160
|
-
}
|
|
161
|
-
}));
|
|
162
|
-
this._register(addDisposableListener(this.layoutService.mainContainer, EventType.WHEEL, e => e.preventDefault(), { passive: false }));
|
|
163
|
-
this._register(addDisposableListener(this.layoutService.mainContainer, EventType.CONTEXT_MENU, e => EventHelper.stop(e, true)));
|
|
164
|
-
this._register(addDisposableListener(this.layoutService.mainContainer, EventType.DROP, e => EventHelper.stop(e, true)));
|
|
165
|
-
}
|
|
166
|
-
onWillShutdown() {
|
|
167
|
-
Event.toPromise(Event.any(Event.once(( (new DomEmitter(mainWindow.document.body, EventType.KEY_DOWN, true))).event), Event.once(( (new DomEmitter(mainWindow.document.body, EventType.MOUSE_DOWN, true))).event))).then(async () => {
|
|
168
|
-
await timeout(3000);
|
|
169
|
-
await this.dialogService.prompt({
|
|
170
|
-
type: Severity$1.Error,
|
|
171
|
-
message: ( localizeWithPath(
|
|
172
|
-
_moduleId,
|
|
173
|
-
7,
|
|
174
|
-
"An unexpected error occurred that requires a reload of this page."
|
|
175
|
-
)),
|
|
176
|
-
detail: ( localizeWithPath(_moduleId, 8, "The workbench was unexpectedly disposed while running.")),
|
|
177
|
-
buttons: [
|
|
178
|
-
{
|
|
179
|
-
label: ( localizeWithPath(_moduleId, 9, "&&Reload")),
|
|
180
|
-
run: () => mainWindow.location.reload()
|
|
181
|
-
}
|
|
182
|
-
]
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
create() {
|
|
187
|
-
this.setupOpenHandlers();
|
|
188
|
-
this.registerLabelFormatters();
|
|
189
|
-
this.registerCommands();
|
|
190
|
-
this.setupDriver();
|
|
191
|
-
}
|
|
192
|
-
setupDriver() {
|
|
193
|
-
if (this.environmentService.enableSmokeTestDriver) {
|
|
194
|
-
registerWindowDriver(this.instantiationService);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
setupOpenHandlers() {
|
|
198
|
-
this.openerService.setDefaultExternalOpener({
|
|
199
|
-
openExternal: async (href) => {
|
|
200
|
-
let isAllowedOpener = false;
|
|
201
|
-
if (this.browserEnvironmentService.options?.openerAllowedExternalUrlPrefixes) {
|
|
202
|
-
for (const trustedPopupPrefix of this.browserEnvironmentService.options.openerAllowedExternalUrlPrefixes) {
|
|
203
|
-
if (href.startsWith(trustedPopupPrefix)) {
|
|
204
|
-
isAllowedOpener = true;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
if (matchesScheme(href, Schemas.http) || matchesScheme(href, Schemas.https)) {
|
|
210
|
-
if (isSafari) {
|
|
211
|
-
const opened = windowOpenWithSuccess(href, !isAllowedOpener);
|
|
212
|
-
if (!opened) {
|
|
213
|
-
await this.dialogService.prompt({
|
|
214
|
-
type: Severity$1.Warning,
|
|
215
|
-
message: ( localizeWithPath(
|
|
216
|
-
_moduleId,
|
|
217
|
-
10,
|
|
218
|
-
"The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."
|
|
219
|
-
)),
|
|
220
|
-
detail: href,
|
|
221
|
-
buttons: [
|
|
222
|
-
{
|
|
223
|
-
label: ( localizeWithPath(_moduleId, 11, "&&Open")),
|
|
224
|
-
run: () => isAllowedOpener ? windowOpenPopup(href) : windowOpenNoOpener(href)
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
label: ( localizeWithPath(_moduleId, 12, "&&Learn More")),
|
|
228
|
-
run: () => this.openerService.open(( (URI.parse('https://aka.ms/allow-vscode-popup'))))
|
|
229
|
-
}
|
|
230
|
-
],
|
|
231
|
-
cancelButton: true
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
isAllowedOpener
|
|
237
|
-
? windowOpenPopup(href)
|
|
238
|
-
: windowOpenNoOpener(href);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
else {
|
|
242
|
-
const invokeProtocolHandler = () => {
|
|
243
|
-
this.lifecycleService.withExpectedShutdown({ disableShutdownHandling: true }, () => mainWindow.location.href = href);
|
|
244
|
-
};
|
|
245
|
-
invokeProtocolHandler();
|
|
246
|
-
const showProtocolUrlOpenedDialog = async () => {
|
|
247
|
-
const { downloadUrl } = this.productService;
|
|
248
|
-
let detail;
|
|
249
|
-
const buttons = [
|
|
250
|
-
{
|
|
251
|
-
label: ( localizeWithPath(_moduleId, 13, "&&Try Again")),
|
|
252
|
-
run: () => invokeProtocolHandler()
|
|
253
|
-
}
|
|
254
|
-
];
|
|
255
|
-
if (downloadUrl !== undefined) {
|
|
256
|
-
detail = ( localizeWithPath(
|
|
257
|
-
_moduleId,
|
|
258
|
-
14,
|
|
259
|
-
"We launched {0} on your computer.\n\nIf {1} did not launch, try again or install it below.",
|
|
260
|
-
this.productService.nameLong,
|
|
261
|
-
this.productService.nameLong
|
|
262
|
-
));
|
|
263
|
-
buttons.push({
|
|
264
|
-
label: ( localizeWithPath(_moduleId, 15, "&&Install")),
|
|
265
|
-
run: async () => {
|
|
266
|
-
await this.openerService.open(( (URI.parse(downloadUrl))));
|
|
267
|
-
showProtocolUrlOpenedDialog();
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
detail = ( localizeWithPath(
|
|
273
|
-
_moduleId,
|
|
274
|
-
16,
|
|
275
|
-
"We launched {0} on your computer.\n\nIf {1} did not launch, try again below.",
|
|
276
|
-
this.productService.nameLong,
|
|
277
|
-
this.productService.nameLong
|
|
278
|
-
));
|
|
279
|
-
}
|
|
280
|
-
await this.hostService.withExpectedShutdown(() => this.dialogService.prompt({
|
|
281
|
-
type: Severity$1.Info,
|
|
282
|
-
message: ( localizeWithPath(_moduleId, 17, "All done. You can close this tab now.")),
|
|
283
|
-
detail,
|
|
284
|
-
buttons,
|
|
285
|
-
cancelButton: true
|
|
286
|
-
}));
|
|
287
|
-
};
|
|
288
|
-
if (matchesScheme(href, this.productService.urlProtocol)) {
|
|
289
|
-
await showProtocolUrlOpenedDialog();
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
return true;
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
registerLabelFormatters() {
|
|
297
|
-
this._register(this.labelService.registerFormatter({
|
|
298
|
-
scheme: Schemas.vscodeUserData,
|
|
299
|
-
priority: true,
|
|
300
|
-
formatting: {
|
|
301
|
-
label: '(Settings) ${path}',
|
|
302
|
-
separator: '/',
|
|
303
|
-
}
|
|
304
|
-
}));
|
|
305
|
-
}
|
|
306
|
-
registerCommands() {
|
|
307
|
-
CommandsRegistry.registerCommand('workbench.experimental.requestUsbDevice', async (_accessor, options) => {
|
|
308
|
-
return requestUsbDevice(options);
|
|
309
|
-
});
|
|
310
|
-
CommandsRegistry.registerCommand('workbench.experimental.requestSerialPort', async (_accessor, options) => {
|
|
311
|
-
return requestSerialPort(options);
|
|
312
|
-
});
|
|
313
|
-
CommandsRegistry.registerCommand('workbench.experimental.requestHidDevice', async (_accessor, options) => {
|
|
314
|
-
return requestHidDevice(options);
|
|
315
|
-
});
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
BrowserWindow = ( (__decorate([
|
|
319
|
-
( (__param(0, IOpenerService))),
|
|
320
|
-
( (__param(1, ILifecycleService))),
|
|
321
|
-
( (__param(2, IDialogService))),
|
|
322
|
-
( (__param(3, ILabelService))),
|
|
323
|
-
( (__param(4, IProductService))),
|
|
324
|
-
( (__param(5, IBrowserWorkbenchEnvironmentService))),
|
|
325
|
-
( (__param(6, IWorkbenchLayoutService))),
|
|
326
|
-
( (__param(7, IInstantiationService))),
|
|
327
|
-
( (__param(8, IHostService)))
|
|
328
|
-
], BrowserWindow)));
|
|
329
|
-
|
|
330
|
-
export { BaseWindow, BrowserWindow };
|