|
3 | 3 | * Licensed under the MIT License. See License.txt in the project root for license information. |
4 | 4 | *--------------------------------------------------------------------------------------------*/ |
5 | 5 |
|
6 | | -import { localize } from 'vs/nls'; |
7 | | -import { MenuRegistry } from 'vs/platform/actions/common/actions'; |
8 | | -import { CommandsRegistry } from 'vs/platform/commands/common/commands'; |
9 | | -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; |
10 | 6 | import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; |
11 | 7 | import { Registry } from 'vs/platform/registry/common/platform'; |
12 | 8 | import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; |
13 | | -import { Extensions as Input, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; |
14 | | -import { PerfviewContrib, PerfviewInput } from 'vs/workbench/contrib/performance/electron-browser/perfviewEditor'; |
15 | | -import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; |
16 | 9 | import { StartupProfiler } from './startupProfiler'; |
17 | 10 | import { StartupTimings } from './startupTimings'; |
18 | 11 |
|
19 | | -// -- startup performance view |
20 | | - |
21 | | -Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution( |
22 | | - PerfviewContrib, |
23 | | - LifecyclePhase.Ready |
24 | | -); |
25 | | - |
26 | | -Registry.as<IEditorInputFactoryRegistry>(Input.EditorInputFactories).registerEditorInputFactory( |
27 | | - PerfviewInput.Id, |
28 | | - class implements IEditorInputFactory { |
29 | | - canSerialize(): boolean { |
30 | | - return true; |
31 | | - } |
32 | | - serialize(): string { |
33 | | - return ''; |
34 | | - } |
35 | | - deserialize(instantiationService: IInstantiationService): PerfviewInput { |
36 | | - return instantiationService.createInstance(PerfviewInput); |
37 | | - } |
38 | | - } |
39 | | -); |
40 | | - |
41 | | -CommandsRegistry.registerCommand('perfview.show', accessor => { |
42 | | - const editorService = accessor.get(IEditorService); |
43 | | - const instaService = accessor.get(IInstantiationService); |
44 | | - return editorService.openEditor(instaService.createInstance(PerfviewInput)); |
45 | | -}); |
46 | | - |
47 | | -MenuRegistry.addCommand({ |
48 | | - id: 'perfview.show', |
49 | | - category: localize({ key: 'show.cat', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"), |
50 | | - title: localize('show.label', "Startup Performance") |
51 | | -}); |
52 | | - |
53 | | - |
54 | 12 | // -- startup profiler |
55 | 13 |
|
56 | 14 | Registry.as<IWorkbenchContributionsRegistry>(Extensions.Workbench).registerWorkbenchContribution( |
|
0 commit comments