@codingame/monaco-vscode-api 1.85.1 → 1.85.2

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.
Files changed (63) hide show
  1. package/README.md +14 -5
  2. package/missing-services.js +305 -63
  3. package/monaco-editor-treemending.patch +946 -946
  4. package/package.json +8 -7
  5. package/service-override/tools/editor.js +1 -1
  6. package/services.js +10 -6
  7. package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
  8. package/vscode/src/vs/platform/extensionManagement/common/extensionEnablementService.js +140 -0
  9. package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
  10. package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
  11. package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
  12. package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
  13. package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
  14. package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
  15. package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
  16. package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
  17. package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
  18. package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
  19. package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
  20. package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
  21. package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
  22. package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
  23. package/vscode/src/vs/workbench/contrib/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
  24. package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +73 -2
  25. package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +6 -6
  26. package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
  27. package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
  28. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
  29. package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +20 -1
  30. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
  31. package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
  32. package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
  33. package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
  34. package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
  35. package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
  36. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
  37. package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
  38. package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
  39. package/vscode/src/vs/workbench/services/search/common/search.js +3 -3
  40. package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
  41. package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
  42. package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
  43. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
  44. package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
  45. package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
  46. package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
  47. package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
  48. package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
  49. package/vscode/src/vs/platform/url/common/urlService.js +0 -17
  50. package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
  51. package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
  52. package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
  53. package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
  54. package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
  55. package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
  56. package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
  57. package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
  58. package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
  59. package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
  60. package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
  61. package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
  62. package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
  63. package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
@@ -1,408 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
3
- import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
4
- import { IEditorService } from '../../editor/common/editorService.js';
5
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
6
- import { isFolderToOpen, isWorkspaceToOpen, isFileToOpen } from '../../../../platform/window/common/window.js';
7
- import { pathsToEditors, isResourceEditorInput } from '../../../common/editor.js';
8
- import { whenEditorClosed } from '../../../browser/editor.js';
9
- import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
10
- import { ILabelService } from 'monaco-editor/esm/vs/platform/label/common/label.js';
11
- import { ModifierKeyEmitter, onDidRegisterWindow, trackFocus, getActiveDocument, getWindowId, disposableWindowInterval } from 'monaco-editor/esm/vs/base/browser/dom.js';
12
- import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
13
- import { IBrowserWorkbenchEnvironmentService } from '../../environment/browser/environmentService.js';
14
- import { memoize } from 'monaco-editor/esm/vs/base/common/decorators.js';
15
- import { parseLineAndColumnAware } from 'monaco-editor/esm/vs/base/common/extpath.js';
16
- import { IWorkspaceEditingService } from '../../workspaces/common/workspaceEditing.js';
17
- import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
18
- import { ILifecycleService } from '../../lifecycle/common/lifecycle.js';
19
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
20
- import { getWorkspaceIdentifier } from '../../workspaces/browser/workspaces.js';
21
- import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
22
- import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
23
- import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
24
- import { DomEmitter } from 'monaco-editor/esm/vs/base/browser/event.js';
25
- import { isUndefined } from 'monaco-editor/esm/vs/base/common/types.js';
26
- import { isTemporaryWorkspace, IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
27
- import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
28
- import { IUserDataProfileService } from '../../userDataProfile/common/userDataProfile.js';
29
- import { coalesce } from 'monaco-editor/esm/vs/base/common/arrays.js';
30
- import { mainWindow, isAuxiliaryWindow } from 'monaco-editor/esm/vs/base/browser/window.js';
31
- import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
32
- var HostShutdownReason;
33
- ( (function(HostShutdownReason) {
34
- HostShutdownReason[HostShutdownReason["Unknown"] = 1] = "Unknown";
35
- HostShutdownReason[HostShutdownReason["Keyboard"] = 2] = "Keyboard";
36
- HostShutdownReason[HostShutdownReason["Api"] = 3] = "Api";
37
- })(HostShutdownReason || (HostShutdownReason = {})));
38
- let BrowserHostService = class BrowserHostService extends Disposable {
39
- constructor(layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfileService) {
40
- super();
41
- this.layoutService = layoutService;
42
- this.configurationService = configurationService;
43
- this.fileService = fileService;
44
- this.labelService = labelService;
45
- this.environmentService = environmentService;
46
- this.instantiationService = instantiationService;
47
- this.lifecycleService = lifecycleService;
48
- this.logService = logService;
49
- this.dialogService = dialogService;
50
- this.contextService = contextService;
51
- this.userDataProfileService = userDataProfileService;
52
- this.shutdownReason = HostShutdownReason.Unknown;
53
- if (environmentService.options?.workspaceProvider) {
54
- this.workspaceProvider = environmentService.options.workspaceProvider;
55
- }
56
- else {
57
- this.workspaceProvider = new class {
58
- constructor() {
59
- this.workspace = undefined;
60
- this.trusted = undefined;
61
- }
62
- async open() { return true; }
63
- };
64
- }
65
- this.registerListeners();
66
- }
67
- registerListeners() {
68
- this._register(this.lifecycleService.onBeforeShutdown(e => this.onBeforeShutdown(e)));
69
- this._register(ModifierKeyEmitter.getInstance().event(() => this.updateShutdownReasonFromEvent()));
70
- }
71
- onBeforeShutdown(e) {
72
- switch (this.shutdownReason) {
73
- case HostShutdownReason.Unknown:
74
- case HostShutdownReason.Keyboard: {
75
- const confirmBeforeClose = this.configurationService.getValue('window.confirmBeforeClose');
76
- if (confirmBeforeClose === 'always' || (confirmBeforeClose === 'keyboardOnly' && this.shutdownReason === HostShutdownReason.Keyboard)) {
77
- e.veto(true, 'veto.confirmBeforeClose');
78
- }
79
- break;
80
- }
81
- }
82
- this.shutdownReason = HostShutdownReason.Unknown;
83
- }
84
- updateShutdownReasonFromEvent() {
85
- if (this.shutdownReason === HostShutdownReason.Api) {
86
- return;
87
- }
88
- if (ModifierKeyEmitter.getInstance().isModifierPressed) {
89
- this.shutdownReason = HostShutdownReason.Keyboard;
90
- }
91
- else {
92
- this.shutdownReason = HostShutdownReason.Unknown;
93
- }
94
- }
95
- get onDidChangeFocus() {
96
- const emitter = this._register(( new Emitter()));
97
- this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => {
98
- const focusTracker = disposables.add(trackFocus(window));
99
- const visibilityTracker = disposables.add(( new DomEmitter(window.document, 'visibilitychange')));
100
- Event.any(( Event.map(focusTracker.onDidFocus, () => this.hasFocus, disposables)), ( Event.map(focusTracker.onDidBlur, () => this.hasFocus, disposables)), ( Event.map(visibilityTracker.event, () => this.hasFocus, disposables)), ( Event.map(this.onDidChangeActiveWindow, () => this.hasFocus, disposables)))(focus => emitter.fire(focus));
101
- }, { window: mainWindow, disposables: this._store }));
102
- return Event.latch(emitter.event, undefined, this._store);
103
- }
104
- get hasFocus() {
105
- return getActiveDocument().hasFocus();
106
- }
107
- async hadLastFocus() {
108
- return true;
109
- }
110
- async focus(targetWindow) {
111
- targetWindow.focus();
112
- }
113
- get onDidChangeActiveWindow() {
114
- const emitter = this._register(( new Emitter()));
115
- this._register(Event.runAndSubscribe(onDidRegisterWindow, ({ window, disposables }) => {
116
- const windowId = getWindowId(window);
117
- const focusTracker = disposables.add(trackFocus(window));
118
- disposables.add(focusTracker.onDidFocus(() => emitter.fire(windowId)));
119
- if (isAuxiliaryWindow(window)) {
120
- disposables.add(disposableWindowInterval(window, () => {
121
- const hasFocus = window.document.hasFocus();
122
- if (hasFocus) {
123
- emitter.fire(windowId);
124
- }
125
- return hasFocus;
126
- }, 100, 20));
127
- }
128
- }, { window: mainWindow, disposables: this._store }));
129
- return Event.latch(emitter.event, undefined, this._store);
130
- }
131
- openWindow(arg1, arg2) {
132
- if (Array.isArray(arg1)) {
133
- return this.doOpenWindow(arg1, arg2);
134
- }
135
- return this.doOpenEmptyWindow(arg1);
136
- }
137
- async doOpenWindow(toOpen, options) {
138
- const payload = this.preservePayload(false );
139
- const fileOpenables = [];
140
- const foldersToAdd = [];
141
- for (const openable of toOpen) {
142
- openable.label = openable.label || this.getRecentLabel(openable);
143
- if (isFolderToOpen(openable)) {
144
- if (options?.addMode) {
145
- foldersToAdd.push(({ uri: openable.folderUri }));
146
- }
147
- else {
148
- this.doOpen({ folderUri: openable.folderUri }, { reuse: this.shouldReuse(options, false ), payload });
149
- }
150
- }
151
- else if (isWorkspaceToOpen(openable)) {
152
- this.doOpen({ workspaceUri: openable.workspaceUri }, { reuse: this.shouldReuse(options, false ), payload });
153
- }
154
- else if (isFileToOpen(openable)) {
155
- fileOpenables.push(openable);
156
- }
157
- }
158
- if (foldersToAdd.length > 0) {
159
- this.withServices(accessor => {
160
- const workspaceEditingService = accessor.get(IWorkspaceEditingService);
161
- workspaceEditingService.addFolders(foldersToAdd);
162
- });
163
- }
164
- if (fileOpenables.length > 0) {
165
- this.withServices(async (accessor) => {
166
- const editorService = accessor.get(IEditorService);
167
- if (options?.mergeMode && fileOpenables.length === 4) {
168
- const editors = coalesce(await pathsToEditors(fileOpenables, this.fileService, this.logService));
169
- if (editors.length !== 4 || !isResourceEditorInput(editors[0]) || !isResourceEditorInput(editors[1]) || !isResourceEditorInput(editors[2]) || !isResourceEditorInput(editors[3])) {
170
- return;
171
- }
172
- if (this.shouldReuse(options, true )) {
173
- editorService.openEditor({
174
- input1: { resource: editors[0].resource },
175
- input2: { resource: editors[1].resource },
176
- base: { resource: editors[2].resource },
177
- result: { resource: editors[3].resource },
178
- options: { pinned: true }
179
- });
180
- }
181
- else {
182
- const environment = ( new Map());
183
- environment.set('mergeFile1', ( editors[0].resource.toString()));
184
- environment.set('mergeFile2', ( editors[1].resource.toString()));
185
- environment.set('mergeFileBase', ( editors[2].resource.toString()));
186
- environment.set('mergeFileResult', ( editors[3].resource.toString()));
187
- this.doOpen(undefined, { payload: Array.from(environment.entries()) });
188
- }
189
- }
190
- if (options?.diffMode && fileOpenables.length === 2) {
191
- const editors = coalesce(await pathsToEditors(fileOpenables, this.fileService, this.logService));
192
- if (editors.length !== 2 || !isResourceEditorInput(editors[0]) || !isResourceEditorInput(editors[1])) {
193
- return;
194
- }
195
- if (this.shouldReuse(options, true )) {
196
- editorService.openEditor({
197
- original: { resource: editors[0].resource },
198
- modified: { resource: editors[1].resource },
199
- options: { pinned: true }
200
- });
201
- }
202
- else {
203
- const environment = ( new Map());
204
- environment.set('diffFileSecondary', ( editors[0].resource.toString()));
205
- environment.set('diffFilePrimary', ( editors[1].resource.toString()));
206
- this.doOpen(undefined, { payload: Array.from(environment.entries()) });
207
- }
208
- }
209
- else {
210
- for (const openable of fileOpenables) {
211
- if (this.shouldReuse(options, true )) {
212
- let openables = [];
213
- if (options?.gotoLineMode) {
214
- const pathColumnAware = parseLineAndColumnAware(openable.fileUri.path);
215
- openables = [{
216
- fileUri: openable.fileUri.with({ path: pathColumnAware.path }),
217
- options: {
218
- selection: !isUndefined(pathColumnAware.line) ? { startLineNumber: pathColumnAware.line, startColumn: pathColumnAware.column || 1 } : undefined
219
- }
220
- }];
221
- }
222
- else {
223
- openables = [openable];
224
- }
225
- editorService.openEditors(coalesce(await pathsToEditors(openables, this.fileService, this.logService)), undefined, { validateTrust: true });
226
- }
227
- else {
228
- const environment = ( new Map());
229
- environment.set('openFile', ( openable.fileUri.toString()));
230
- if (options?.gotoLineMode) {
231
- environment.set('gotoLineMode', 'true');
232
- }
233
- this.doOpen(undefined, { payload: Array.from(environment.entries()) });
234
- }
235
- }
236
- }
237
- const waitMarkerFileURI = options?.waitMarkerFileURI;
238
- if (waitMarkerFileURI) {
239
- (async () => {
240
- await this.instantiationService.invokeFunction(accessor => whenEditorClosed(accessor, ( fileOpenables.map(fileOpenable => fileOpenable.fileUri))));
241
- await this.fileService.del(waitMarkerFileURI);
242
- })();
243
- }
244
- });
245
- }
246
- }
247
- withServices(fn) {
248
- this.instantiationService.invokeFunction(accessor => fn(accessor));
249
- }
250
- preservePayload(isEmptyWindow) {
251
- const newPayload = ( new Array());
252
- if (!isEmptyWindow && this.environmentService.extensionDevelopmentLocationURI) {
253
- newPayload.push(['extensionDevelopmentPath', ( this.environmentService.extensionDevelopmentLocationURI.toString())]);
254
- if (this.environmentService.debugExtensionHost.debugId) {
255
- newPayload.push(['debugId', this.environmentService.debugExtensionHost.debugId]);
256
- }
257
- if (this.environmentService.debugExtensionHost.port) {
258
- newPayload.push(['inspect-brk-extensions', String(this.environmentService.debugExtensionHost.port)]);
259
- }
260
- }
261
- if (!this.userDataProfileService.currentProfile.isDefault) {
262
- newPayload.push(['lastActiveProfile', this.userDataProfileService.currentProfile.id]);
263
- }
264
- return newPayload.length ? newPayload : undefined;
265
- }
266
- getRecentLabel(openable) {
267
- if (isFolderToOpen(openable)) {
268
- return this.labelService.getWorkspaceLabel(openable.folderUri, { verbose: 2 });
269
- }
270
- if (isWorkspaceToOpen(openable)) {
271
- return this.labelService.getWorkspaceLabel(getWorkspaceIdentifier(openable.workspaceUri), { verbose: 2 });
272
- }
273
- return this.labelService.getUriLabel(openable.fileUri);
274
- }
275
- shouldReuse(options = Object.create(null), isFile) {
276
- if (options.waitMarkerFileURI) {
277
- return true;
278
- }
279
- const windowConfig = this.configurationService.getValue('window');
280
- const openInNewWindowConfig = isFile ? ((windowConfig?.openFilesInNewWindow || 'off') ) : ((windowConfig?.openFoldersInNewWindow || 'default') );
281
- let openInNewWindow = (options.preferNewWindow || !!options.forceNewWindow) && !options.forceReuseWindow;
282
- if (!options.forceNewWindow && !options.forceReuseWindow && (openInNewWindowConfig === 'on' || openInNewWindowConfig === 'off')) {
283
- openInNewWindow = (openInNewWindowConfig === 'on');
284
- }
285
- return !openInNewWindow;
286
- }
287
- async doOpenEmptyWindow(options) {
288
- return this.doOpen(undefined, {
289
- reuse: options?.forceReuseWindow,
290
- payload: this.preservePayload(true )
291
- });
292
- }
293
- async doOpen(workspace, options) {
294
- if (workspace && isFolderToOpen(workspace) && workspace.folderUri.scheme === Schemas.file && isTemporaryWorkspace(this.contextService.getWorkspace())) {
295
- this.withServices(async (accessor) => {
296
- const workspaceEditingService = accessor.get(IWorkspaceEditingService);
297
- await workspaceEditingService.updateFolders(0, this.contextService.getWorkspace().folders.length, [{ uri: workspace.folderUri }]);
298
- });
299
- return;
300
- }
301
- if (options?.reuse) {
302
- await this.handleExpectedShutdown(4 );
303
- }
304
- const opened = await this.workspaceProvider.open(workspace, options);
305
- if (!opened) {
306
- const { confirmed } = await this.dialogService.confirm({
307
- type: Severity.Warning,
308
- message: ( localizeWithPath(
309
- 'vs/workbench/services/host/browser/browserHostService',
310
- 'unableToOpenExternal',
311
- "The browser interrupted the opening of a new tab or window. Press 'Open' to open it anyway."
312
- )),
313
- primaryButton: ( localizeWithPath(
314
- 'vs/workbench/services/host/browser/browserHostService',
315
- { key: 'open', comment: ['&& denotes a mnemonic'] },
316
- "&&Open"
317
- ))
318
- });
319
- if (confirmed) {
320
- await this.workspaceProvider.open(workspace, options);
321
- }
322
- }
323
- }
324
- async toggleFullScreen(targetWindow) {
325
- const target = this.layoutService.getContainer(targetWindow);
326
- if (targetWindow.document.fullscreen !== undefined) {
327
- if (!targetWindow.document.fullscreen) {
328
- try {
329
- return await target.requestFullscreen();
330
- }
331
- catch (error) {
332
- this.logService.warn('toggleFullScreen(): requestFullscreen failed');
333
- }
334
- }
335
- else {
336
- try {
337
- return await targetWindow.document.exitFullscreen();
338
- }
339
- catch (error) {
340
- this.logService.warn('toggleFullScreen(): exitFullscreen failed');
341
- }
342
- }
343
- }
344
- if (targetWindow.document.webkitIsFullScreen !== undefined) {
345
- try {
346
- if (!targetWindow.document.webkitIsFullScreen) {
347
- target.webkitRequestFullscreen();
348
- }
349
- else {
350
- targetWindow.document.webkitExitFullscreen();
351
- }
352
- }
353
- catch {
354
- this.logService.warn('toggleFullScreen(): requestFullscreen/exitFullscreen failed');
355
- }
356
- }
357
- }
358
- async moveTop(targetWindow) {
359
- }
360
- async getCursorScreenPoint() {
361
- return undefined;
362
- }
363
- async restart() {
364
- this.reload();
365
- }
366
- async reload() {
367
- await this.handleExpectedShutdown(3 );
368
- mainWindow.location.reload();
369
- }
370
- async close() {
371
- await this.handleExpectedShutdown(1 );
372
- mainWindow.close();
373
- }
374
- async withExpectedShutdown(expectedShutdownTask) {
375
- const previousShutdownReason = this.shutdownReason;
376
- try {
377
- this.shutdownReason = HostShutdownReason.Api;
378
- return await expectedShutdownTask();
379
- }
380
- finally {
381
- this.shutdownReason = previousShutdownReason;
382
- }
383
- }
384
- async handleExpectedShutdown(reason) {
385
- this.shutdownReason = HostShutdownReason.Api;
386
- return this.lifecycleService.withExpectedShutdown(reason);
387
- }
388
- };
389
- BrowserHostService.__decorator = ( __decorate([
390
- memoize
391
- ], BrowserHostService.prototype, "onDidChangeFocus", null));
392
- BrowserHostService.__decorator = ( __decorate([
393
- memoize
394
- ], BrowserHostService.prototype, "onDidChangeActiveWindow", null));
395
- BrowserHostService = ( __decorate([
396
- ( __param(0, ILayoutService)),
397
- ( __param(1, IConfigurationService)),
398
- ( __param(2, IFileService)),
399
- ( __param(3, ILabelService)),
400
- ( __param(4, IBrowserWorkbenchEnvironmentService)),
401
- ( __param(5, IInstantiationService)),
402
- ( __param(6, ILifecycleService)),
403
- ( __param(7, ILogService)),
404
- ( __param(8, IDialogService)),
405
- ( __param(9, IWorkspaceContextService)),
406
- ( __param(10, IUserDataProfileService))
407
- ], BrowserHostService));
408
- export { BrowserHostService };
@@ -1,48 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
3
- import { ILoggerService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
4
- import { RequestChannelClient } from '../../../../platform/request/common/requestIpc.js';
5
- import { IRemoteAgentService } from '../../remote/common/remoteAgentService.js';
6
- import { RequestService } from '../../../../platform/request/browser/requestService.js';
7
- import { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
8
- let BrowserRequestService = class BrowserRequestService extends RequestService {
9
- constructor(remoteAgentService, configurationService, loggerService) {
10
- super(configurationService, loggerService);
11
- this.remoteAgentService = remoteAgentService;
12
- }
13
- async request(options, token) {
14
- try {
15
- const context = await super.request(options, token);
16
- const connection = this.remoteAgentService.getConnection();
17
- if (connection && context.res.statusCode === 405) {
18
- return this._makeRemoteRequest(connection, options, token);
19
- }
20
- return context;
21
- }
22
- catch (error) {
23
- const connection = this.remoteAgentService.getConnection();
24
- if (connection) {
25
- return this._makeRemoteRequest(connection, options, token);
26
- }
27
- throw error;
28
- }
29
- }
30
- _makeRemoteRequest(connection, options, token) {
31
- return connection.withChannel('request', channel => ( new RequestChannelClient(channel)).request(options, token));
32
- }
33
- };
34
- BrowserRequestService = ( __decorate([
35
- ( __param(0, IRemoteAgentService)),
36
- ( __param(1, IConfigurationService)),
37
- ( __param(2, ILoggerService))
38
- ], BrowserRequestService));
39
- CommandsRegistry.registerCommand('_workbench.fetchJSON', async function (accessor, url, method) {
40
- const result = await fetch(url, { method, headers: { Accept: 'application/json' } });
41
- if (result.ok) {
42
- return result.json();
43
- }
44
- else {
45
- throw new Error(result.statusText);
46
- }
47
- });
48
- export { BrowserRequestService };
@@ -1,56 +0,0 @@
1
- import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
2
- import { AbstractTextFileService } from './textFileService.js';
3
- import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
4
- import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
5
- import { IModelService } from 'monaco-editor/esm/vs/editor/common/services/model.js';
6
- import { ILanguageService } from 'monaco-editor/esm/vs/editor/common/languages/language.js';
7
- import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
8
- import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
9
- import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
10
- import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
11
- import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
12
- import { IElevatedFileService } from '../../files/common/elevatedFileService.js';
13
- import { IFilesConfigurationService } from '../../filesConfiguration/common/filesConfigurationService.js';
14
- import { ILifecycleService } from '../../lifecycle/common/lifecycle.js';
15
- import { IPathService } from '../../path/common/pathService.js';
16
- import { IUntitledTextEditorService } from '../../untitled/common/untitledTextEditorService.js';
17
- import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
18
- import { IWorkingCopyFileService } from '../../workingCopy/common/workingCopyFileService.js';
19
- import { IDecorationsService } from '../../decorations/common/decorations.js';
20
- import { IDialogService, IFileDialogService } from '../../../../platform/dialogs/common/dialogs.js';
21
- let BrowserTextFileService = class BrowserTextFileService extends AbstractTextFileService {
22
- constructor(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, elevatedFileService, logService, decorationsService) {
23
- super(fileService, untitledTextEditorService, lifecycleService, instantiationService, modelService, environmentService, dialogService, fileDialogService, textResourceConfigurationService, filesConfigurationService, codeEditorService, pathService, workingCopyFileService, uriIdentityService, languageService, logService, elevatedFileService, decorationsService);
24
- this.registerListeners();
25
- }
26
- registerListeners() {
27
- this._register(this.lifecycleService.onBeforeShutdown(event => event.veto(this.onBeforeShutdown(), 'veto.textFiles')));
28
- }
29
- onBeforeShutdown() {
30
- if (( this.files.models.some(model => model.hasState(2 )))) {
31
- return true;
32
- }
33
- return false;
34
- }
35
- };
36
- BrowserTextFileService = ( __decorate([
37
- ( __param(0, IFileService)),
38
- ( __param(1, IUntitledTextEditorService)),
39
- ( __param(2, ILifecycleService)),
40
- ( __param(3, IInstantiationService)),
41
- ( __param(4, IModelService)),
42
- ( __param(5, IWorkbenchEnvironmentService)),
43
- ( __param(6, IDialogService)),
44
- ( __param(7, IFileDialogService)),
45
- ( __param(8, ITextResourceConfigurationService)),
46
- ( __param(9, IFilesConfigurationService)),
47
- ( __param(10, ICodeEditorService)),
48
- ( __param(11, IPathService)),
49
- ( __param(12, IWorkingCopyFileService)),
50
- ( __param(13, IUriIdentityService)),
51
- ( __param(14, ILanguageService)),
52
- ( __param(15, IElevatedFileService)),
53
- ( __param(16, ILogService)),
54
- ( __param(17, IDecorationsService))
55
- ], BrowserTextFileService));
56
- export { BrowserTextFileService };