mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 20:13:32 +01:00
editors - cleanup editor restore logic
This commit is contained in:
@@ -15,6 +15,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
|
||||
import { IAccessibilityService } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { Barrier } from 'vs/base/common/async';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
|
||||
/* __GDPR__FRAGMENT__
|
||||
"IMemoryInfo" : {
|
||||
@@ -357,8 +358,8 @@ export interface IStartupMetrics {
|
||||
readonly ellapsedPanelRestore: number;
|
||||
|
||||
/**
|
||||
* The time it took to restore editors - that is text editor and complex editor likes the settings UI
|
||||
* or webviews (markdown preview).
|
||||
* The time it took to restore and fully resolve visible editors - that is text editor
|
||||
* and complex editor likes the settings UI or webviews (markdown preview).
|
||||
*
|
||||
* * Happens in the renderer-process
|
||||
* * Measured with the `willRestoreEditors` and `didRestoreEditors` performance marks.
|
||||
@@ -482,10 +483,12 @@ export abstract class AbstractTimerService implements ITimerService {
|
||||
@IEditorService private readonly _editorService: IEditorService,
|
||||
@IAccessibilityService private readonly _accessibilityService: IAccessibilityService,
|
||||
@ITelemetryService private readonly _telemetryService: ITelemetryService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
|
||||
) {
|
||||
Promise.all([
|
||||
this._extensionService.whenInstalledExtensionsRegistered(),
|
||||
_lifecycleService.when(LifecyclePhase.Restored)
|
||||
this._extensionService.whenInstalledExtensionsRegistered(), // extensions registered
|
||||
_lifecycleService.when(LifecyclePhase.Restored), // workbench created and parts restored
|
||||
layoutService.whenRestored // layout restored (including visible editors resolved)
|
||||
]).then(() => {
|
||||
// set perf mark from renderer
|
||||
this.setPerformanceMarks('renderer', perf.getMarks());
|
||||
|
||||
@@ -17,6 +17,7 @@ import { IStartupMetrics, AbstractTimerService, Writeable, ITimerService } from
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { process } from 'vs/base/parts/sandbox/electron-sandbox/globals';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
|
||||
export class TimerService extends AbstractTimerService {
|
||||
|
||||
@@ -32,8 +33,9 @@ export class TimerService extends AbstractTimerService {
|
||||
@IEditorService editorService: IEditorService,
|
||||
@IAccessibilityService accessibilityService: IAccessibilityService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService
|
||||
) {
|
||||
super(lifecycleService, contextService, extensionService, updateService, viewletService, panelService, editorService, accessibilityService, telemetryService);
|
||||
super(lifecycleService, contextService, extensionService, updateService, viewletService, panelService, editorService, accessibilityService, telemetryService, layoutService);
|
||||
this.setPerformanceMarks('main', _environmentService.configuration.perfMarks);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user