@theia/core 1.75.0-next.29 → 1.75.0-next.34

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 (142) hide show
  1. package/lib/browser/authentication-service.js +1 -1
  2. package/lib/browser/authentication-service.js.map +1 -1
  3. package/lib/browser/browser-clipboard-service.js +1 -0
  4. package/lib/browser/browser-clipboard-service.js.map +1 -1
  5. package/lib/browser/catalog.json +33 -2
  6. package/lib/browser/connection-status-service.d.ts +1 -0
  7. package/lib/browser/connection-status-service.d.ts.map +1 -1
  8. package/lib/browser/connection-status-service.js +7 -0
  9. package/lib/browser/connection-status-service.js.map +1 -1
  10. package/lib/browser/frontend-application-state.js +1 -0
  11. package/lib/browser/frontend-application-state.js.map +1 -1
  12. package/lib/browser/icon-theme-service.d.ts +5 -3
  13. package/lib/browser/icon-theme-service.d.ts.map +1 -1
  14. package/lib/browser/icon-theme-service.js +7 -1
  15. package/lib/browser/icon-theme-service.js.map +1 -1
  16. package/lib/browser/keyboard/browser-keyboard-layout-provider.js +1 -0
  17. package/lib/browser/keyboard/browser-keyboard-layout-provider.js.map +1 -1
  18. package/lib/browser/open-with-service.d.ts +2 -1
  19. package/lib/browser/open-with-service.d.ts.map +1 -1
  20. package/lib/browser/open-with-service.js +6 -1
  21. package/lib/browser/open-with-service.js.map +1 -1
  22. package/lib/browser/performance/frontend-stopwatch.d.ts +2 -1
  23. package/lib/browser/performance/frontend-stopwatch.d.ts.map +1 -1
  24. package/lib/browser/performance/frontend-stopwatch.js +6 -1
  25. package/lib/browser/performance/frontend-stopwatch.js.map +1 -1
  26. package/lib/browser/perspective-service.js +1 -1
  27. package/lib/browser/perspective-service.js.map +1 -1
  28. package/lib/browser/preferences/preference-proxy.spec.js +3 -0
  29. package/lib/browser/preferences/preference-proxy.spec.js.map +1 -1
  30. package/lib/browser/preferences/preference-service.spec.js +3 -0
  31. package/lib/browser/preferences/preference-service.spec.js.map +1 -1
  32. package/lib/browser/preferences/preference-validation-service.js +1 -1
  33. package/lib/browser/preferences/preference-validation-service.js.map +1 -1
  34. package/lib/browser/saveable-service.d.ts +2 -1
  35. package/lib/browser/saveable-service.d.ts.map +1 -1
  36. package/lib/browser/saveable-service.js +6 -1
  37. package/lib/browser/saveable-service.js.map +1 -1
  38. package/lib/browser/shell/shell-layout-restorer.d.ts +1 -1
  39. package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
  40. package/lib/browser/shell/shell-layout-restorer.js +5 -4
  41. package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
  42. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts +2 -1
  43. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.d.ts.map +1 -1
  44. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js +6 -1
  45. package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.js.map +1 -1
  46. package/lib/browser/status-bar/status-bar-view-model.d.ts +2 -1
  47. package/lib/browser/status-bar/status-bar-view-model.d.ts.map +1 -1
  48. package/lib/browser/status-bar/status-bar-view-model.js +6 -1
  49. package/lib/browser/status-bar/status-bar-view-model.js.map +1 -1
  50. package/lib/browser/storage-service.d.ts +1 -1
  51. package/lib/browser/storage-service.d.ts.map +1 -1
  52. package/lib/browser/storage-service.js +1 -0
  53. package/lib/browser/storage-service.js.map +1 -1
  54. package/lib/browser/tree/tree-model.d.ts.map +1 -1
  55. package/lib/browser/tree/tree-model.js +1 -0
  56. package/lib/browser/tree/tree-model.js.map +1 -1
  57. package/lib/browser/widget-manager.js +1 -0
  58. package/lib/browser/widget-manager.js.map +1 -1
  59. package/lib/browser/window/default-secondary-window-service.d.ts +2 -1
  60. package/lib/browser/window/default-secondary-window-service.d.ts.map +1 -1
  61. package/lib/browser/window/default-secondary-window-service.js +9 -4
  62. package/lib/browser/window/default-secondary-window-service.js.map +1 -1
  63. package/lib/common/message-service-protocol.d.ts +2 -0
  64. package/lib/common/message-service-protocol.d.ts.map +1 -1
  65. package/lib/common/message-service-protocol.js +8 -2
  66. package/lib/common/message-service-protocol.js.map +1 -1
  67. package/lib/common/performance/stopwatch.js +1 -0
  68. package/lib/common/performance/stopwatch.js.map +1 -1
  69. package/lib/common/preferences/preference-schema-service.d.ts +2 -0
  70. package/lib/common/preferences/preference-schema-service.d.ts.map +1 -1
  71. package/lib/common/preferences/preference-schema-service.js +11 -5
  72. package/lib/common/preferences/preference-schema-service.js.map +1 -1
  73. package/lib/common/preferences/preference-service.d.ts +2 -0
  74. package/lib/common/preferences/preference-service.d.ts.map +1 -1
  75. package/lib/common/preferences/preference-service.js +7 -1
  76. package/lib/common/preferences/preference-service.js.map +1 -1
  77. package/lib/node/backend-application.js +5 -5
  78. package/lib/node/backend-application.js.map +1 -1
  79. package/lib/node/backend-application.spec.js +6 -3
  80. package/lib/node/backend-application.spec.js.map +1 -1
  81. package/lib/node/env-variables/env-variables-server.d.ts +2 -0
  82. package/lib/node/env-variables/env-variables-server.d.ts.map +1 -1
  83. package/lib/node/env-variables/env-variables-server.js +7 -1
  84. package/lib/node/env-variables/env-variables-server.js.map +1 -1
  85. package/lib/node/hosting/browser-connection-token.d.ts +2 -0
  86. package/lib/node/hosting/browser-connection-token.d.ts.map +1 -1
  87. package/lib/node/hosting/browser-connection-token.js +14 -1
  88. package/lib/node/hosting/browser-connection-token.js.map +1 -1
  89. package/lib/node/hosting/browser-connection-token.spec.js +25 -2
  90. package/lib/node/hosting/browser-connection-token.spec.js.map +1 -1
  91. package/lib/node/key-store-server.d.ts +2 -0
  92. package/lib/node/key-store-server.d.ts.map +1 -1
  93. package/lib/node/key-store-server.js +6 -1
  94. package/lib/node/key-store-server.js.map +1 -1
  95. package/lib/node/messaging/default-messaging-service.js +1 -1
  96. package/lib/node/messaging/default-messaging-service.js.map +1 -1
  97. package/lib/node/messaging/ipc-connection-provider.js +1 -0
  98. package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
  99. package/lib/node/messaging/websocket-endpoint.js +1 -1
  100. package/lib/node/messaging/websocket-endpoint.js.map +1 -1
  101. package/lib/node/messaging/websocket-frontend-connection-service.d.ts +2 -1
  102. package/lib/node/messaging/websocket-frontend-connection-service.d.ts.map +1 -1
  103. package/lib/node/messaging/websocket-frontend-connection-service.js +11 -6
  104. package/lib/node/messaging/websocket-frontend-connection-service.js.map +1 -1
  105. package/lib/node/setting-service.js +1 -0
  106. package/lib/node/setting-service.js.map +1 -1
  107. package/package.json +4 -4
  108. package/src/browser/authentication-service.ts +1 -1
  109. package/src/browser/browser-clipboard-service.ts +2 -2
  110. package/src/browser/connection-status-service.ts +7 -3
  111. package/src/browser/frontend-application-state.ts +2 -2
  112. package/src/browser/icon-theme-service.ts +6 -2
  113. package/src/browser/keyboard/browser-keyboard-layout-provider.ts +2 -2
  114. package/src/browser/open-with-service.ts +6 -3
  115. package/src/browser/performance/frontend-stopwatch.ts +6 -3
  116. package/src/browser/perspective-service.ts +1 -1
  117. package/src/browser/preferences/preference-proxy.spec.ts +3 -0
  118. package/src/browser/preferences/preference-service.spec.ts +3 -0
  119. package/src/browser/preferences/preference-validation-service.ts +1 -1
  120. package/src/browser/saveable-service.ts +5 -2
  121. package/src/browser/shell/shell-layout-restorer.ts +6 -5
  122. package/src/browser/shell/tab-bar-toolbar/tab-bar-toolbar-registry.ts +5 -2
  123. package/src/browser/status-bar/status-bar-view-model.ts +7 -3
  124. package/src/browser/storage-service.ts +4 -2
  125. package/src/browser/tree/tree-model.ts +4 -2
  126. package/src/browser/widget-manager.ts +1 -1
  127. package/src/browser/window/default-secondary-window-service.ts +9 -6
  128. package/src/common/message-service-protocol.ts +7 -3
  129. package/src/common/performance/stopwatch.ts +2 -2
  130. package/src/common/preferences/preference-schema-service.ts +9 -5
  131. package/src/common/preferences/preference-service.ts +6 -2
  132. package/src/node/backend-application.spec.ts +6 -3
  133. package/src/node/backend-application.ts +5 -5
  134. package/src/node/env-variables/env-variables-server.ts +6 -2
  135. package/src/node/hosting/browser-connection-token.spec.ts +30 -3
  136. package/src/node/hosting/browser-connection-token.ts +13 -2
  137. package/src/node/key-store-server.ts +6 -3
  138. package/src/node/messaging/default-messaging-service.ts +1 -1
  139. package/src/node/messaging/ipc-connection-provider.ts +2 -2
  140. package/src/node/messaging/websocket-endpoint.ts +1 -1
  141. package/src/node/messaging/websocket-frontend-connection-service.ts +11 -8
  142. package/src/node/setting-service.ts +2 -2
@@ -14,7 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { injectable, postConstruct, inject } from 'inversify';
17
+ import { injectable, postConstruct, inject, named } from 'inversify';
18
18
  import { isOSX } from '../../common/os';
19
19
  import { Emitter, Event } from '../../common/event';
20
20
  import { ILogger } from '../../common/logger';
@@ -29,7 +29,7 @@ export type KeyboardLayoutSource = 'navigator.keyboard' | 'user-choice' | 'press
29
29
  @injectable()
30
30
  export class BrowserKeyboardLayoutProvider implements KeyboardLayoutProvider, KeyboardLayoutChangeNotifier, KeyValidator {
31
31
 
32
- @inject(ILogger)
32
+ @inject(ILogger) @named('core:BrowserKeyboardLayoutProvider')
33
33
  protected readonly logger: ILogger;
34
34
 
35
35
  @inject(LocalStorageService)
@@ -14,14 +14,14 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { inject, injectable } from 'inversify';
17
+ import { inject, injectable, named } from 'inversify';
18
18
  import { Disposable } from '../common/disposable';
19
19
  import { nls } from '../common/nls';
20
20
  import { MaybePromise } from '../common/types';
21
21
  import { URI } from '../common/uri';
22
22
  import { QuickInputService, QuickPickItem, QuickPickItemOrSeparator } from './quick-input';
23
23
  import { getDefaultHandler } from './opener-service';
24
- import { PreferenceService, PreferenceScope } from '../common';
24
+ import { PreferenceService, PreferenceScope, ILogger } from '../common';
25
25
 
26
26
  export interface OpenWithHandler {
27
27
  /**
@@ -74,11 +74,14 @@ export class OpenWithService {
74
74
  @inject(PreferenceService)
75
75
  protected readonly preferenceService: PreferenceService;
76
76
 
77
+ @inject(ILogger) @named('core:OpenWithService')
78
+ protected readonly logger: ILogger;
79
+
77
80
  protected readonly handlers: OpenWithHandler[] = [];
78
81
 
79
82
  registerHandler(handler: OpenWithHandler): Disposable {
80
83
  if (this.handlers.some(h => h.id === handler.id)) {
81
- console.warn('Duplicate OpenWithHandler registration: ' + handler.id);
84
+ this.logger.warn('Duplicate OpenWithHandler registration: ' + handler.id);
82
85
  return Disposable.NULL;
83
86
  }
84
87
  this.handlers.push(handler);
@@ -14,12 +14,15 @@
14
14
  * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  *******************************************************************************/
16
16
 
17
- import { injectable } from 'inversify';
18
- import { Measurement, MeasurementOptions, Stopwatch } from '../../common';
17
+ import { injectable, inject, named } from 'inversify';
18
+ import { Measurement, MeasurementOptions, Stopwatch, ILogger } from '../../common';
19
19
 
20
20
  @injectable()
21
21
  export class FrontendStopwatch extends Stopwatch {
22
22
 
23
+ @inject(ILogger) @named('core:FrontendStopwatch')
24
+ protected override readonly logger: ILogger;
25
+
23
26
  constructor() {
24
27
  super({
25
28
  owner: 'frontend page',
@@ -51,7 +54,7 @@ export class FrontendStopwatch extends Stopwatch {
51
54
  duration = entries[0].duration ?? Number.NaN;
52
55
  startTime = entries[0].startTime ?? Number.NaN;
53
56
  } catch (e) {
54
- console.warn(e);
57
+ this.logger.warn(e);
55
58
  duration = Number.NaN;
56
59
  startTime = Number.NaN;
57
60
  }
@@ -196,7 +196,7 @@ export class PerspectiveServiceImpl implements FrontendApplicationContribution,
196
196
  @inject(QuickInputService) @optional()
197
197
  protected readonly quickInputService: QuickInputService | undefined;
198
198
 
199
- @inject(ILogger) @named('core:PerspectiveService')
199
+ @inject(ILogger) @named('core:PerspectiveServiceImpl')
200
200
  protected readonly logger: ILogger;
201
201
 
202
202
  @inject(WidgetAreaResolver)
@@ -28,6 +28,8 @@ import { PreferenceScope } from '../../common/preferences/preference-scope';
28
28
  import { FrontendApplicationConfigProvider } from '../frontend-application-config-provider';
29
29
  import { PreferenceProxyOptions, PreferenceProxy, PreferenceChangeEvent, createPreferenceProxy } from '../../common/preferences/preference-proxy';
30
30
  import { PreferenceProxyFactory } from '../../common/preferences/injectable-preference-proxy';
31
+ import { ILogger } from '../../common/logger';
32
+ import { MockLogger } from '../../common/test/mock-logger';
31
33
 
32
34
  disableJSDOM();
33
35
 
@@ -47,6 +49,7 @@ function createTestContainer(): Container {
47
49
  const result = new Container();
48
50
  bindPreferenceService(result.bind.bind(result));
49
51
  bindMockPreferenceProviders(result.bind.bind(result), result.unbind.bind(result));
52
+ result.bind(ILogger).to(MockLogger);
50
53
  return result;
51
54
  }
52
55
 
@@ -28,6 +28,8 @@ import { FrontendApplicationConfigProvider } from '../frontend-application-confi
28
28
  import { bindMockPreferenceProviders, MockPreferenceProvider } from './test';
29
29
  import { PreferenceChangeEvent, createPreferenceProxy } from '../../common/preferences/preference-proxy';
30
30
  import { bindPreferenceService } from '../frontend-application-bindings';
31
+ import { ILogger } from '../../common/logger';
32
+ import { MockLogger } from '../../common/test/mock-logger';
31
33
 
32
34
  disableJSDOM();
33
35
 
@@ -43,6 +45,7 @@ function createTestContainer(): Container {
43
45
  const result = new Container();
44
46
  bindPreferenceService(result.bind.bind(result));
45
47
  bindMockPreferenceProviders(result.bind.bind(result), result.unbind.bind(result));
48
+ result.bind(ILogger).to(MockLogger);
46
49
  return result;
47
50
  }
48
51
 
@@ -175,7 +175,7 @@ export class PreferenceValidationService {
175
175
  const configuredDefault = this.getDefaultFromSchema(schema);
176
176
  return this.validateOneOf(key, configuredDefault, { ...schema, default: undefined });
177
177
  }
178
- console.log(`While validating ${key}, failed to find a valid value or default value. Using configured value ${value}.`);
178
+ this.logger.info(`While validating ${key}, failed to find a valid value or default value. Using configured value ${value}.`);
179
179
  return value;
180
180
  }
181
181
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  import type { ApplicationShell } from './shell';
18
18
  import { inject, injectable, named } from 'inversify';
19
- import { ContributionProvider, UNTITLED_SCHEME, URI, Disposable, DisposableCollection, Emitter, Event } from '../common';
19
+ import { ContributionProvider, UNTITLED_SCHEME, URI, Disposable, DisposableCollection, Emitter, Event, ILogger } from '../common';
20
20
  import { Navigatable, NavigatableWidget } from './navigatable-types';
21
21
  import { AutoSaveMode, Saveable, SaveableSource, SaveableWidget, SaveOptions, SaveReason, setDirty, close, PostCreationSaveableWidget, ShouldSaveDialog } from './saveable';
22
22
  import { waitForClosed, Widget } from './widgets';
@@ -53,6 +53,9 @@ export class SaveableService implements FrontendApplicationContribution {
53
53
  @inject(WindowFocusService)
54
54
  protected readonly windowFocusService: WindowFocusService;
55
55
 
56
+ @inject(ILogger) @named('core:SaveableService')
57
+ protected readonly logger: ILogger;
58
+
56
59
  protected saveThrottles = new Map<Widget, AutoSaveThrottle>();
57
60
  protected saveMode: AutoSaveMode = 'off';
58
61
  protected saveDelay = 1000;
@@ -284,7 +287,7 @@ export class SaveableService implements FrontendApplicationContribution {
284
287
  }
285
288
  const saveable = Saveable.get(widget);
286
289
  if (!saveable) {
287
- console.warn('Saveable.get returned undefined on a known saveable widget. This is unexpected.');
290
+ this.logger.warn('Saveable.get returned undefined on a known saveable widget. This is unexpected.');
288
291
  }
289
292
  // Enter branch if saveable absent since we cannot check autosaveability more definitely.
290
293
  if (this.autoSave !== 'off' && (!saveable || this.shouldAutoSave(widget, saveable))) {
@@ -154,7 +154,8 @@ export class ShellLayoutRestorer implements CommandContribution {
154
154
 
155
155
  constructor(
156
156
  @inject(WidgetManager) protected widgetManager: WidgetManager,
157
- @inject(ILogger) protected logger: ILogger,
157
+ @inject(ILogger) @named('core:ShellLayoutRestorer')
158
+ protected readonly logger: ILogger,
158
159
  @inject(StorageService) protected storageService: StorageService) { }
159
160
 
160
161
  registerCommands(commands: CommandRegistry): void {
@@ -374,18 +375,18 @@ export class ShellLayoutRestorer implements CommandContribution {
374
375
  }
375
376
  if (layoutVersion !== applicationShellLayoutVersion) {
376
377
  if (layoutVersion < applicationShellLayoutVersion) {
377
- console.warn(`Layout version ${layoutVersion} is behind current layout version ${applicationShellLayoutVersion}, trying to migrate...`);
378
+ this.logger.warn(`Layout version ${layoutVersion} is behind current layout version ${applicationShellLayoutVersion}, trying to migrate...`);
378
379
  } else {
379
- console.warn(`Layout version ${layoutVersion} is ahead current layout version ${applicationShellLayoutVersion}, trying to load anyway...`);
380
+ this.logger.warn(`Layout version ${layoutVersion} is ahead current layout version ${applicationShellLayoutVersion}, trying to load anyway...`);
380
381
  }
381
- console.info(`Please use '${RESET_LAYOUT.label}' command if the layout looks bogus.`);
382
+ this.logger.info(`Please use '${RESET_LAYOUT.label}' command if the layout looks bogus.`);
382
383
  }
383
384
 
384
385
  const migrations = this.migrations.getContributions()
385
386
  .filter(m => m.layoutVersion > layoutVersion && m.layoutVersion <= applicationShellLayoutVersion)
386
387
  .sort((m, m2) => m.layoutVersion - m2.layoutVersion);
387
388
  if (migrations.length) {
388
- console.info(`Found ${migrations.length} migrations from layout version ${layoutVersion} to version ${applicationShellLayoutVersion}, migrating...`);
389
+ this.logger.info(`Found ${migrations.length} migrations from layout version ${layoutVersion} to version ${applicationShellLayoutVersion}, migrating...`);
389
390
  }
390
391
 
391
392
  const context = { layout, layoutVersion, migrations };
@@ -17,7 +17,7 @@
17
17
  import debounce = require('lodash.debounce');
18
18
  import { inject, injectable, named } from 'inversify';
19
19
  // eslint-disable-next-line max-len
20
- import { CommandRegistry, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuPath } from '../../../common';
20
+ import { CommandRegistry, ContributionProvider, Disposable, DisposableCollection, Emitter, Event, MenuModelRegistry, MenuPath, ILogger } from '../../../common';
21
21
  import { ContextKeyService } from '../../context-key-service';
22
22
  import { FrontendApplicationContribution } from '../../frontend-application-contribution';
23
23
  import { Widget } from '../../widgets';
@@ -68,6 +68,9 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
68
68
  @inject(ContributionProvider) @named(TabBarToolbarContribution)
69
69
  protected readonly contributionProvider: ContributionProvider<TabBarToolbarContribution>;
70
70
 
71
+ @inject(ILogger) @named('core:TabBarToolbarRegistry')
72
+ protected readonly logger: ILogger;
73
+
71
74
  protected readonly onDidChangeEmitter = new Emitter<void>();
72
75
  readonly onDidChange: Event<void> = this.onDidChangeEmitter.event;
73
76
  // debounce in order to avoid to fire more than once in the same tick
@@ -223,7 +226,7 @@ export class TabBarToolbarRegistry implements FrontendApplicationContribution {
223
226
  this.fireOnDidChange();
224
227
  return { dispose: () => this.unregisterMenuDelegate(menuPath) };
225
228
  }
226
- console.warn('Unable to register menu delegate. Delegate has already been registered', menuPath);
229
+ this.logger.warn('Unable to register menu delegate. Delegate has already been registered', menuPath);
227
230
  return Disposable.NULL;
228
231
  }
229
232
 
@@ -14,8 +14,8 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { injectable } from 'inversify';
18
- import { ArrayUtils, Emitter, Event } from '../../common';
17
+ import { injectable, inject, named } from 'inversify';
18
+ import { ArrayUtils, Emitter, Event, ILogger } from '../../common';
19
19
  import { StatusBarAlignment, StatusBarEntry, StatusBarViewEntry, StatusBarViewModelEntry } from './status-bar-types';
20
20
 
21
21
  interface EntryLocation {
@@ -30,6 +30,10 @@ export class StatusBarViewModel {
30
30
  protected rightTree = new Array<StatusBarViewModelEntry>();
31
31
  protected containerPointers = new Map<string, StatusBarViewModelEntry[]>();
32
32
  protected onDidChangeEmitter = new Emitter<void>();
33
+
34
+ @inject(ILogger) @named('core:StatusBarViewModel')
35
+ protected readonly logger: ILogger;
36
+
33
37
  get onDidChange(): Event<void> {
34
38
  return this.onDidChangeEmitter.event;
35
39
  }
@@ -53,7 +57,7 @@ export class StatusBarViewModel {
53
57
  *getChildren(list: StatusBarViewModelEntry[], alignment: StatusBarAlignment, compact?: boolean): IterableIterator<StatusBarViewEntry> {
54
58
  for (const item of list) {
55
59
  if (item.leftChildren.length || item.rightChildren.length) {
56
- console.warn(`Found embedded entries with affinity to ${item.id}. They will inherit alignment and compactness of parent.`);
60
+ this.logger.warn(`Found embedded entries with affinity to ${item.id}. They will inherit alignment and compactness of parent.`);
57
61
  }
58
62
  yield* this.getChildren(item.leftChildren, alignment, item.head.affinity?.compact);
59
63
  yield { entry: item.head, id: item.id, alignment, compact: compact || item.head.affinity?.compact };
@@ -14,7 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { inject, injectable, postConstruct } from 'inversify';
17
+ import { inject, injectable, postConstruct, named } from 'inversify';
18
18
  import { ILogger } from '../common/logger';
19
19
  import { MessageService } from '../common/message-service';
20
20
  import { WindowService } from './window/window-service';
@@ -47,7 +47,9 @@ interface LocalStorage {
47
47
  export class LocalStorageService implements StorageService {
48
48
  private storage: LocalStorage;
49
49
 
50
- @inject(ILogger) protected logger: ILogger;
50
+ @inject(ILogger) @named('core:LocalStorageService')
51
+ protected readonly logger: ILogger;
52
+
51
53
  @inject(MessageService) protected readonly messageService: MessageService;
52
54
  @inject(WindowService) protected readonly windowService: WindowService;
53
55
 
@@ -14,7 +14,7 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { inject, injectable, postConstruct } from 'inversify';
17
+ import { inject, injectable, postConstruct, named } from 'inversify';
18
18
  import { Event, Emitter, WaitUntilEvent } from '../../common/event';
19
19
  import { DisposableCollection } from '../../common/disposable';
20
20
  import { CancellationToken } from '../../common/cancellation';
@@ -165,7 +165,9 @@ export interface TreeModel extends Tree, TreeSelectionService, TreeExpansionServ
165
165
  @injectable()
166
166
  export class TreeModelImpl implements TreeModel, SelectionProvider<ReadonlyArray<Readonly<SelectableTreeNode>>> {
167
167
 
168
- @inject(ILogger) protected readonly logger: ILogger;
168
+ @inject(ILogger) @named('core:TreeModelImpl')
169
+ protected readonly logger: ILogger;
170
+
169
171
  @inject(Tree) protected readonly tree: Tree;
170
172
  @inject(TreeSelectionService) protected readonly selectionService: TreeSelectionService;
171
173
  @inject(TreeExpansionService) protected readonly expansionService: TreeExpansionService;
@@ -119,7 +119,7 @@ export class WidgetManager {
119
119
  @inject(ContributionProvider) @named(WidgetFactory)
120
120
  protected readonly factoryProvider: ContributionProvider<WidgetFactory>;
121
121
 
122
- @inject(ILogger)
122
+ @inject(ILogger) @named('core:WidgetManager')
123
123
  protected readonly logger: ILogger;
124
124
 
125
125
  protected readonly onWillCreateWidgetEmitter = new Emitter<WillCreateWidgetEvent>();
@@ -13,13 +13,13 @@
13
13
  //
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
- import { inject, injectable, postConstruct } from 'inversify';
16
+ import { inject, injectable, postConstruct, named } from 'inversify';
17
17
  import { SecondaryWindow, SecondaryWindowService } from './secondary-window-service';
18
18
  import { WindowService } from './window-service';
19
19
  import { ExtractableWidget, Widget } from '../widgets';
20
20
  import { ApplicationShell } from '../shell';
21
21
  import { Saveable } from '../saveable';
22
- import { Emitter, environment, Event, PreferenceService } from '../../common';
22
+ import { Emitter, environment, Event, PreferenceService, ILogger } from '../../common';
23
23
  import { SaveableService } from '../saveable-service';
24
24
  import { getAllWidgetsFromSecondaryWindow, getDefaultRestoreArea } from '../secondary-window-handler';
25
25
  import { WindowFocusService } from './window-focus-service';
@@ -59,17 +59,20 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService {
59
59
  @inject(WindowFocusService)
60
60
  protected readonly windowFocusService: WindowFocusService;
61
61
 
62
+ @inject(ILogger) @named('core:DefaultSecondaryWindowService')
63
+ protected readonly logger: ILogger;
64
+
62
65
  @postConstruct()
63
66
  init(): void {
64
67
  // Set up messaging with secondary windows
65
68
  window.addEventListener('message', (event: MessageEvent) => {
66
- console.trace('Message on main window', event);
69
+ this.logger.trace('Message on main window', event);
67
70
  if (event.data.fromSecondary) {
68
- console.trace('Message comes from secondary window');
71
+ this.logger.trace('Message comes from secondary window');
69
72
  return;
70
73
  }
71
74
  if (event.data.fromMain) {
72
- console.trace('Message has mainWindow marker, therefore ignore it');
75
+ this.logger.trace('Message has mainWindow marker, therefore ignore it');
73
76
  return;
74
77
  }
75
78
 
@@ -80,7 +83,7 @@ export class DefaultSecondaryWindowService implements SecondaryWindowService {
80
83
  return;
81
84
  }
82
85
 
83
- console.trace('Delegate main window message to secondary windows', event);
86
+ this.logger.trace('Delegate main window message to secondary windows', event);
84
87
  this.secondaryWindows.forEach(secondaryWindow => {
85
88
  if (!secondaryWindow.window.closed) {
86
89
  secondaryWindow.window.postMessage({ ...event.data, fromMain: true }, '*');
@@ -14,9 +14,10 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { injectable } from 'inversify';
17
+ import { injectable, inject, named } from 'inversify';
18
18
  import { CancellationToken } from './cancellation';
19
19
  import { nls } from './nls';
20
+ import { ILogger } from './logger';
20
21
 
21
22
  export const messageServicePath = '/services/messageService';
22
23
 
@@ -115,6 +116,9 @@ export interface ProgressUpdate {
115
116
  @injectable()
116
117
  export class MessageClient {
117
118
 
119
+ @inject(ILogger) @named('core:MessageClient')
120
+ protected readonly logger: ILogger;
121
+
118
122
  /**
119
123
  * Show a message of the given type and possible actions to the user.
120
124
  * Resolve to a chosen action.
@@ -123,7 +127,7 @@ export class MessageClient {
123
127
  * To be implemented by an extension, e.g. by the messages extension.
124
128
  */
125
129
  showMessage(message: Message): Promise<string | undefined> {
126
- console.info(message.text);
130
+ this.logger.info(message.text);
127
131
  return Promise.resolve(undefined);
128
132
  }
129
133
 
@@ -133,7 +137,7 @@ export class MessageClient {
133
137
  * To be implemented by an extension, e.g. by the messages extension.
134
138
  */
135
139
  showProgress(progressId: string, message: ProgressMessage, cancellationToken: CancellationToken): Promise<string | undefined> {
136
- console.info(message.text);
140
+ this.logger.info(message.text);
137
141
  return Promise.resolve(undefined);
138
142
  }
139
143
 
@@ -16,7 +16,7 @@
16
16
 
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
 
19
- import { inject, injectable, unmanaged } from 'inversify';
19
+ import { inject, injectable, unmanaged, named } from 'inversify';
20
20
  import { ILogger, LogLevel } from '../logger';
21
21
  import { MaybePromise } from '../types';
22
22
  import { Measurement, MeasurementOptions, MeasurementResult } from './measurement';
@@ -48,7 +48,7 @@ interface LogOptions extends MeasurementOptions {
48
48
  @injectable()
49
49
  export abstract class Stopwatch {
50
50
 
51
- @inject(ILogger)
51
+ @inject(ILogger) @named('core:Stopwatch')
52
52
  protected readonly logger: ILogger;
53
53
 
54
54
  protected _storedMeasurements: MeasurementResult[] = [];
@@ -24,6 +24,7 @@ import { PreferenceScope, ValidPreferenceScopes } from './preference-scope';
24
24
  import { PreferenceUtils } from './preference-provider';
25
25
  import { ContributionProvider } from '../contribution-provider';
26
26
  import { Deferred } from '../promise-util';
27
+ import { ILogger } from '../logger';
27
28
 
28
29
  export const NO_OVERRIDE = {};
29
30
  export const OVERRIDE_PROPERTY = '\\[(.*)\\]$';
@@ -78,6 +79,9 @@ export class PreferenceSchemaServiceImpl implements PreferenceSchemaService {
78
79
  @inject(ContributionProvider) @named(PreferenceContribution)
79
80
  protected readonly preferenceContributions: ContributionProvider<PreferenceContribution>;
80
81
 
82
+ @inject(ILogger) @named('core:PreferenceSchemaServiceImpl')
83
+ protected readonly logger: ILogger;
84
+
81
85
  @postConstruct()
82
86
  protected init(): void {
83
87
  for (const scope of this.validScopes) {
@@ -128,7 +132,7 @@ export class PreferenceSchemaServiceImpl implements PreferenceSchemaService {
128
132
 
129
133
  for (const [key, property] of Object.entries(schema.properties)) {
130
134
  if (this.properties.has(key)) {
131
- console.warn(`Property with id '${key}' already exists`);
135
+ this.logger.warn(`Property with id '${key}' already exists`);
132
136
  continue;
133
137
  }
134
138
  this.pendingDefaultRegistrationWarnings?.delete(key);
@@ -210,14 +214,14 @@ export class PreferenceSchemaServiceImpl implements PreferenceSchemaService {
210
214
  this.setJSONSchemasProperty(key, updatedProperty);
211
215
  this.schemaChangedEmitter.fire();
212
216
  } else {
213
- console.warn(`Trying to update non-existent property ${key}`);
217
+ this.logger.warn(`Trying to update non-existent property ${key}`);
214
218
  }
215
219
  }
216
220
 
217
221
  protected pendingDefaultRegistrationWarnings: Set<string> | undefined = new Set();
218
222
  protected logDefaultRegistrationWarnings(): void {
219
223
  if (this.pendingDefaultRegistrationWarnings?.size) {
220
- console.warn('Default overrides registered for these keys, but preferences not registered', Array.from(this.pendingDefaultRegistrationWarnings));
224
+ this.logger.warn('Default overrides registered for these keys, but preferences not registered', Array.from(this.pendingDefaultRegistrationWarnings));
221
225
  }
222
226
  this.pendingDefaultRegistrationWarnings = undefined;
223
227
  }
@@ -226,7 +230,7 @@ export class PreferenceSchemaServiceImpl implements PreferenceSchemaService {
226
230
  if (this.pendingDefaultRegistrationWarnings) {
227
231
  this.pendingDefaultRegistrationWarnings.add(key);
228
232
  } else {
229
- console.warn(`Trying to register default override for non-existent preference: ${key}`);
233
+ this.logger.warn(`Trying to register default override for non-existent preference: ${key}`);
230
234
  }
231
235
  }
232
236
 
@@ -236,7 +240,7 @@ export class PreferenceSchemaServiceImpl implements PreferenceSchemaService {
236
240
  if (!property) {
237
241
  this.logDefaultRegistrationWarning(key);
238
242
  } else if (!property.overridable && overrideIdentifier) {
239
- console.warn(`Trying to register default override for identifier ${overrideIdentifier} for non-overridable preference: ${key}`);
243
+ this.logger.warn(`Trying to register default override for identifier ${overrideIdentifier} for non-overridable preference: ${key}`);
240
244
  }
241
245
 
242
246
  let overrides = this.defaultOverrides.get(key);
@@ -17,7 +17,7 @@
17
17
  /* eslint-disable @typescript-eslint/no-explicit-any */
18
18
 
19
19
  import { JSONValue } from '@lumino/coreutils';
20
- import { inject, injectable, postConstruct } from 'inversify';
20
+ import { inject, injectable, postConstruct, named } from 'inversify';
21
21
  import { Disposable, DisposableCollection } from '../disposable';
22
22
  import { Emitter, Event } from '../event';
23
23
  import { Deferred } from '../promise-util';
@@ -29,6 +29,7 @@ import { PreferenceScope } from './preference-scope';
29
29
  import { PreferenceConfigurations } from './preference-configurations';
30
30
  import { deepFreeze } from '../objects';
31
31
  import { unreachable } from '../types';
32
+ import { ILogger } from '../logger';
32
33
 
33
34
  /**
34
35
  * Representation of a preference change. A preference value can be set to `undefined` for a specific scope.
@@ -296,6 +297,9 @@ export class PreferenceServiceImpl implements PreferenceService {
296
297
  @inject(PreferenceLanguageOverrideService)
297
298
  protected readonly preferenceOverrideService: PreferenceLanguageOverrideService;
298
299
 
300
+ @inject(ILogger) @named('core:PreferenceServiceImpl')
301
+ protected readonly logger: ILogger;
302
+
299
303
  protected readonly preferenceProviders = new Map<PreferenceScope, PreferenceProvider>();
300
304
 
301
305
  protected async initializeProviders(): Promise<void> {
@@ -309,7 +313,7 @@ export class PreferenceServiceImpl implements PreferenceService {
309
313
  ));
310
314
  await provider.ready;
311
315
  } else {
312
- console.warn(`No preference provider bound for ${PreferenceScope[scope]}`);
316
+ this.logger.warn(`No preference provider bound for ${PreferenceScope[scope]}`);
313
317
  }
314
318
  }
315
319
  this._ready.resolve();
@@ -142,7 +142,8 @@ describe('BackendApplication', () => {
142
142
  const container = createTestContainer();
143
143
  const cleanupError = new Error('cleanup boom');
144
144
  sandbox.stub(container, 'unbindAllAsync').rejects(cleanupError);
145
- const warnStub = sandbox.stub(console, 'warn');
145
+ const mockLogger = container.get(ILogger) as ILogger;
146
+ const warnStub = sandbox.stub(mockLogger, 'warn');
146
147
 
147
148
  const app = container.get(TestBackendApplication);
148
149
 
@@ -157,7 +158,8 @@ describe('BackendApplication', () => {
157
158
  const clock = sandbox.useFakeTimers();
158
159
  const container = createTestContainer();
159
160
  sandbox.stub(container, 'unbindAllAsync').returns(new Promise<void>(() => { /* never */ }));
160
- const warnStub = sandbox.stub(console, 'warn');
161
+ const mockLogger = container.get(ILogger) as ILogger;
162
+ const warnStub = sandbox.stub(mockLogger, 'warn');
161
163
 
162
164
  const app = container.get(TestBackendApplication);
163
165
 
@@ -220,7 +222,8 @@ describe('BackendApplication', () => {
220
222
  onStop: () => new Promise<void>(() => { /* never */ })
221
223
  });
222
224
  const unbindSpy = sandbox.spy(container, 'unbindAllAsync');
223
- const warnStub = sandbox.stub(console, 'warn');
225
+ const mockLogger = container.get(ILogger) as ILogger;
226
+ const warnStub = sandbox.stub(mockLogger, 'warn');
224
227
 
225
228
  const app = container.get(TestBackendApplication);
226
229
  const shutdownPromise = app.invokeGracefulShutdown();
@@ -226,7 +226,7 @@ export class BackendApplication {
226
226
 
227
227
  // Handles `Ctrl+C` and `kill pid`. Delegates to gracefulShutdown so that
228
228
  // root-scoped singletons get their @preDestroy hooks invoked before exit.
229
- const onSignal = () => { this.gracefulShutdown().catch(err => console.error(err)); };
229
+ const onSignal = () => { this.gracefulShutdown().catch(err => this.logger.error(err)); };
230
230
  process.on('SIGINT', onSignal);
231
231
  process.on('SIGTERM', onSignal);
232
232
  }
@@ -407,7 +407,7 @@ export class BackendApplication {
407
407
  ]);
408
408
  } catch (err) {
409
409
  const message = err instanceof Error ? err.message : String(err);
410
- console.warn(`Backend contributions cleanup failed: ${message}`);
410
+ this.logger.warn(`Backend contributions cleanup failed: ${message}`);
411
411
  }
412
412
 
413
413
  try {
@@ -417,7 +417,7 @@ export class BackendApplication {
417
417
  ]);
418
418
  } catch (err) {
419
419
  const message = err instanceof Error ? err.message : String(err);
420
- console.warn(`Backend root container cleanup failed: ${message}`);
420
+ this.logger.warn(`Backend root container cleanup failed: ${message}`);
421
421
  }
422
422
 
423
423
  process.exit(1);
@@ -428,7 +428,7 @@ export class BackendApplication {
428
428
  return;
429
429
  }
430
430
  this.stoppedContributions = true;
431
- console.info('>>> Stopping backend contributions...');
431
+ this.logger.info('>>> Stopping backend contributions...');
432
432
  // The `async` wrapper converts a synchronous throw inside a non-async
433
433
  // contribution's `onStop` into a rejected promise so the per-contribution
434
434
  // try/catch can handle it; otherwise `Promise.all` would abort.
@@ -441,7 +441,7 @@ export class BackendApplication {
441
441
  }
442
442
  }
443
443
  }));
444
- console.info('<<< All backend contributions have been stopped.');
444
+ this.logger.info('<<< All backend contributions have been stopped.');
445
445
  }
446
446
 
447
447
  protected onStop(): void {
@@ -16,7 +16,7 @@
16
16
 
17
17
  import { join } from 'path';
18
18
  import { homedir } from 'os';
19
- import { injectable } from 'inversify';
19
+ import { injectable, inject, named } from 'inversify';
20
20
  import * as drivelist from 'drivelist';
21
21
  import { pathExists, mkdir } from 'fs-extra';
22
22
  import { EnvVariable, EnvVariablesServer } from '../../common/env-variables';
@@ -24,6 +24,7 @@ import { isWindows } from '../../common/os';
24
24
  import { FileUri } from '../../common/file-uri';
25
25
  import { BackendApplicationPath } from '../backend-application';
26
26
  import { BackendApplicationConfigProvider } from '../backend-application-config-provider';
27
+ import { ILogger } from '../../common/logger';
27
28
 
28
29
  @injectable()
29
30
  export class EnvVariablesServerImpl implements EnvVariablesServer {
@@ -33,9 +34,12 @@ export class EnvVariablesServerImpl implements EnvVariablesServer {
33
34
  protected readonly configDirUri: Promise<string>;
34
35
  protected readonly pathExistenceCache: { [key: string]: boolean } = {};
35
36
 
37
+ @inject(ILogger) @named('core:EnvVariablesServerImpl')
38
+ protected readonly logger: ILogger;
39
+
36
40
  constructor() {
37
41
  this.configDirUri = this.createConfigDirUri();
38
- this.configDirUri.then(configDirUri => console.log(`Configuration directory URI: '${configDirUri}'`));
42
+ this.configDirUri.then(configDirUri => this.logger.info(`Configuration directory URI: '${configDirUri}'`));
39
43
  const prEnv = process.env;
40
44
  Object.keys(prEnv).forEach((key: string) => {
41
45
  let keyName = key;