@codingame/monaco-vscode-lifecycle-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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-lifecycle-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
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@
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@6.0.1"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { ShutdownReason, StartupKind } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
2
3
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
3
4
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
4
5
|
import { AbstractLifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycleService';
|
|
5
6
|
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
7
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
6
8
|
import { addDisposableListener, EventType } from 'vscode/vscode/vs/base/browser/dom';
|
|
7
9
|
import { WillSaveStateReason } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
8
10
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
@@ -82,7 +84,7 @@ let BrowserLifecycleService = class BrowserLifecycleService extends AbstractLife
|
|
|
82
84
|
}
|
|
83
85
|
}
|
|
84
86
|
this._onBeforeShutdown.fire({
|
|
85
|
-
reason:
|
|
87
|
+
reason: ShutdownReason.QUIT,
|
|
86
88
|
veto(value, id) {
|
|
87
89
|
handleVeto(value, id);
|
|
88
90
|
},
|
|
@@ -103,7 +105,7 @@ let BrowserLifecycleService = class BrowserLifecycleService extends AbstractLife
|
|
|
103
105
|
this._register(addDisposableListener(mainWindow, EventType.PAGE_SHOW, (e) => this.onLoadAfterUnload(e)));
|
|
104
106
|
const logService = this.logService;
|
|
105
107
|
this._onWillShutdown.fire({
|
|
106
|
-
reason:
|
|
108
|
+
reason: ShutdownReason.QUIT,
|
|
107
109
|
joiners: () => [],
|
|
108
110
|
token: CancellationToken.None,
|
|
109
111
|
join(promise, joiner) {
|
|
@@ -125,7 +127,7 @@ let BrowserLifecycleService = class BrowserLifecycleService extends AbstractLife
|
|
|
125
127
|
if (typeof startupKind !== 'number') {
|
|
126
128
|
const timing = firstOrDefault(performance.getEntriesByType('navigation'));
|
|
127
129
|
if (timing?.type === 'reload') {
|
|
128
|
-
startupKind =
|
|
130
|
+
startupKind = StartupKind.ReloadedWindow;
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
return startupKind;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { getMarks } from 'vscode/vscode/vs/base/common/performance';
|
|
3
|
+
import { WorkbenchState } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
3
4
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
|
|
4
5
|
import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
5
6
|
import { IUpdateService } from 'vscode/vscode/vs/platform/update/common/update.service';
|
|
7
|
+
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle';
|
|
6
8
|
import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
|
|
7
9
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
8
10
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
@@ -10,6 +12,7 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/te
|
|
|
10
12
|
import { Barrier, timeout } from 'vscode/vscode/vs/base/common/async';
|
|
11
13
|
import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
12
14
|
import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
|
|
15
|
+
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
|
|
13
16
|
import { TelemetryTrustedValue } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
14
17
|
import { isWeb } from 'vscode/vscode/vs/base/common/platform';
|
|
15
18
|
import { createBlobWorker } from 'vscode/vscode/vs/base/browser/defaultWorkerFactory';
|
|
@@ -34,6 +37,10 @@ class PerfMarks {
|
|
|
34
37
|
}
|
|
35
38
|
return toEntry.startTime - fromEntry.startTime;
|
|
36
39
|
}
|
|
40
|
+
getStartTime(mark) {
|
|
41
|
+
const entry = this._findEntry(mark);
|
|
42
|
+
return entry ? entry.startTime : -1;
|
|
43
|
+
}
|
|
37
44
|
_findEntry(name) {
|
|
38
45
|
for (const [, marks] of this._entries) {
|
|
39
46
|
for (let i = marks.length - 1; i >= 0; i--) {
|
|
@@ -62,7 +69,7 @@ let AbstractTimerService = class AbstractTimerService {
|
|
|
62
69
|
this._rndValueShouldSendTelemetry = Math.random() < .05;
|
|
63
70
|
Promise.all([
|
|
64
71
|
this._extensionService.whenInstalledExtensionsRegistered(),
|
|
65
|
-
_lifecycleService.when(
|
|
72
|
+
_lifecycleService.when(LifecyclePhase.Restored),
|
|
66
73
|
layoutService.whenRestored,
|
|
67
74
|
Promise.all(( Array.from(( ( Registry.as(TerminalExtensions.Backend)).backends.values())).map(e => e.whenReady)))
|
|
68
75
|
]).then(() => {
|
|
@@ -74,7 +81,7 @@ let AbstractTimerService = class AbstractTimerService {
|
|
|
74
81
|
this._barrier.open();
|
|
75
82
|
});
|
|
76
83
|
this.perfBaseline = this._barrier.wait()
|
|
77
|
-
.then(() => this._lifecycleService.when(
|
|
84
|
+
.then(() => this._lifecycleService.when(LifecyclePhase.Eventually))
|
|
78
85
|
.then(() => timeout(this._startupMetrics.timers.ellapsedRequire))
|
|
79
86
|
.then(() => {
|
|
80
87
|
const jsSrc = ( (function () {
|
|
@@ -129,6 +136,9 @@ let AbstractTimerService = class AbstractTimerService {
|
|
|
129
136
|
getDuration(from, to) {
|
|
130
137
|
return this._marks.getDuration(from, to);
|
|
131
138
|
}
|
|
139
|
+
getStartTime(mark) {
|
|
140
|
+
return this._marks.getStartTime(mark);
|
|
141
|
+
}
|
|
132
142
|
_reportStartupTimes(metrics) {
|
|
133
143
|
this._telemetryService.publicLog('startupTimeVaried', metrics);
|
|
134
144
|
}
|
|
@@ -156,8 +166,8 @@ let AbstractTimerService = class AbstractTimerService {
|
|
|
156
166
|
else {
|
|
157
167
|
startMark = initialStartup ? 'code/didStartMain' : 'code/willOpenNewWindow';
|
|
158
168
|
}
|
|
159
|
-
const activeViewlet = this._paneCompositeService.getActivePaneComposite(
|
|
160
|
-
const activePanel = this._paneCompositeService.getActivePaneComposite(
|
|
169
|
+
const activeViewlet = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Sidebar);
|
|
170
|
+
const activePanel = this._paneCompositeService.getActivePaneComposite(ViewContainerLocation.Panel);
|
|
161
171
|
const info = {
|
|
162
172
|
version: 2,
|
|
163
173
|
ellapsed: this._marks.getDuration(startMark, 'code/didStartWorkbench'),
|
|
@@ -207,7 +217,7 @@ let AbstractTimerService = class AbstractTimerService {
|
|
|
207
217
|
isVMLikelyhood: undefined,
|
|
208
218
|
initialStartup,
|
|
209
219
|
hasAccessibilitySupport: this._accessibilityService.isScreenReaderOptimized(),
|
|
210
|
-
emptyWorkbench: this._contextService.getWorkbenchState() ===
|
|
220
|
+
emptyWorkbench: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY
|
|
211
221
|
};
|
|
212
222
|
await this._extendStartupInfo(info);
|
|
213
223
|
return info;
|