@codingame/monaco-vscode-host-service-override 5.2.0 → 6.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-host-service-override",
3
- "version": "5.2.0",
3
+ "version": "6.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -26,6 +26,6 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@5.2.0"
29
+ "vscode": "npm:@codingame/monaco-vscode-api@6.0.0"
30
30
  }
31
31
  }
@@ -1,6 +1,7 @@
1
1
  import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
2
  import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
3
3
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
4
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
4
5
  import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService.service';
5
6
  import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
6
7
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
@@ -8,6 +9,7 @@ import { isFolderToOpen, isWorkspaceToOpen, isFileToOpen } from 'vscode/vscode/v
8
9
  import { pathsToEditors, isResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor';
9
10
  import { whenEditorClosed } from 'vscode/vscode/vs/workbench/browser/editor';
10
11
  import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
12
+ import { Verbosity } from 'vscode/vscode/vs/platform/label/common/label';
11
13
  import { ILabelService } from 'vscode/vscode/vs/platform/label/common/label.service';
12
14
  import { ModifierKeyEmitter, onDidRegisterWindow, trackFocus, getActiveDocument, getWindowId, disposableWindowInterval, detectFullscreen, EventType, addDisposableListener, addDisposableThrottledListener } from 'vscode/vscode/vs/base/browser/dom';
13
15
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
@@ -15,6 +17,7 @@ import { IBrowserWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/
15
17
  import { memoize } from 'vscode/vscode/vs/base/common/decorators';
16
18
  import { parseLineAndColumnAware } from 'vscode/vscode/vs/base/common/extpath';
17
19
  import { IWorkspaceEditingService } from 'vscode/vscode/vs/workbench/services/workspaces/common/workspaceEditing.service';
20
+ import { ShutdownReason } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
18
21
  import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
19
22
  import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
20
23
  import { getWorkspaceIdentifier } from 'vscode/vscode/vs/workbench/services/workspaces/browser/workspaces';
@@ -30,6 +33,7 @@ import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/use
30
33
  import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
31
34
  import { mainWindow, isAuxiliaryWindow } from 'vscode/vscode/vs/base/browser/window';
32
35
  import { isIOS, isMacintosh } from 'vscode/vscode/vs/base/common/platform';
36
+ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
33
37
 
34
38
  const _moduleId = "vs/workbench/services/host/browser/browserHostService";
35
39
  var HostShutdownReason;
@@ -39,7 +43,7 @@ var HostShutdownReason;
39
43
  HostShutdownReason[HostShutdownReason["Api"] = 3] = "Api";
40
44
  })(HostShutdownReason || (HostShutdownReason = {}))));
41
45
  let BrowserHostService = class BrowserHostService extends Disposable {
42
- constructor(layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfileService) {
46
+ constructor(layoutService, configurationService, fileService, labelService, environmentService, instantiationService, lifecycleService, logService, dialogService, contextService, userDataProfileService, userDataProfilesService) {
43
47
  super();
44
48
  this.layoutService = layoutService;
45
49
  this.configurationService = configurationService;
@@ -52,6 +56,7 @@ let BrowserHostService = class BrowserHostService extends Disposable {
52
56
  this.dialogService = dialogService;
53
57
  this.contextService = contextService;
54
58
  this.userDataProfileService = userDataProfileService;
59
+ this.userDataProfilesService = userDataProfilesService;
55
60
  this.shutdownReason = HostShutdownReason.Unknown;
56
61
  if (environmentService.options?.workspaceProvider) {
57
62
  this.workspaceProvider = environmentService.options.workspaceProvider;
@@ -277,17 +282,21 @@ let BrowserHostService = class BrowserHostService extends Disposable {
277
282
  newPayload.push(['inspect-brk-extensions', String(this.environmentService.debugExtensionHost.port)]);
278
283
  }
279
284
  }
280
- if (!this.userDataProfileService.currentProfile.isDefault) {
281
- newPayload.push(['lastActiveProfile', this.userDataProfileService.currentProfile.id]);
285
+ const windowConfig = this.configurationService.getValue('window');
286
+ const newWindowProfile = (windowConfig?.newWindowProfile
287
+ ? this.userDataProfilesService.profiles.find(profile => profile.name === windowConfig.newWindowProfile)
288
+ : undefined) ?? this.userDataProfileService.currentProfile;
289
+ if (!newWindowProfile.isDefault) {
290
+ newPayload.push(['lastActiveProfile', newWindowProfile.id]);
282
291
  }
283
292
  return newPayload.length ? newPayload : undefined;
284
293
  }
285
294
  getRecentLabel(openable) {
286
295
  if (isFolderToOpen(openable)) {
287
- return this.labelService.getWorkspaceLabel(openable.folderUri, { verbose: 2 });
296
+ return this.labelService.getWorkspaceLabel(openable.folderUri, { verbose: Verbosity.LONG });
288
297
  }
289
298
  if (isWorkspaceToOpen(openable)) {
290
- return this.labelService.getWorkspaceLabel(getWorkspaceIdentifier(openable.workspaceUri), { verbose: 2 });
299
+ return this.labelService.getWorkspaceLabel(getWorkspaceIdentifier(openable.workspaceUri), { verbose: Verbosity.LONG });
291
300
  }
292
301
  return this.labelService.getUriLabel(openable.fileUri);
293
302
  }
@@ -318,7 +327,7 @@ let BrowserHostService = class BrowserHostService extends Disposable {
318
327
  return;
319
328
  }
320
329
  if (options?.reuse) {
321
- await this.handleExpectedShutdown(4 );
330
+ await this.handleExpectedShutdown(ShutdownReason.LOAD);
322
331
  }
323
332
  const opened = await this.workspaceProvider.open(workspace, options);
324
333
  if (!opened) {
@@ -379,11 +388,11 @@ let BrowserHostService = class BrowserHostService extends Disposable {
379
388
  this.reload();
380
389
  }
381
390
  async reload() {
382
- await this.handleExpectedShutdown(3 );
391
+ await this.handleExpectedShutdown(ShutdownReason.RELOAD);
383
392
  mainWindow.location.reload();
384
393
  }
385
394
  async close() {
386
- await this.handleExpectedShutdown(1 );
395
+ await this.handleExpectedShutdown(ShutdownReason.CLOSE);
387
396
  mainWindow.close();
388
397
  }
389
398
  async withExpectedShutdown(expectedShutdownTask) {
@@ -421,7 +430,8 @@ BrowserHostService = ( (__decorate([
421
430
  ( (__param(7, ILogService))),
422
431
  ( (__param(8, IDialogService))),
423
432
  ( (__param(9, IWorkspaceContextService))),
424
- ( (__param(10, IUserDataProfileService)))
433
+ ( (__param(10, IUserDataProfileService))),
434
+ ( (__param(11, IUserDataProfilesService)))
425
435
  ], BrowserHostService)));
426
436
 
427
437
  export { BrowserHostService };
@@ -1,5 +1,6 @@
1
1
  import { Emitter } from 'vscode/vscode/vs/base/common/event';
2
2
  import { addMatchMediaChangeListener } from 'vscode/vscode/vs/base/browser/browser';
3
+ import 'vscode/vscode/vs/platform/instantiation/common/extensions';
3
4
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
5
  import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
5
6
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';