Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js';
7
import { Registry } from '../../../../platform/registry/common/platform.js';
8
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from '../../../common/contributions.js';
9
import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';
10
import { INativeHostService } from '../../../../platform/native/common/native.js';
11
import { Disposable } from '../../../../base/common/lifecycle.js';
12
13
class SleepResumeRepaintMinimap extends Disposable implements IWorkbenchContribution {
14
15
constructor(
16
@ICodeEditorService codeEditorService: ICodeEditorService,
17
@INativeHostService nativeHostService: INativeHostService
18
) {
19
super();
20
21
this._register(nativeHostService.onDidResumeOS(() => {
22
codeEditorService.listCodeEditors().forEach(editor => editor.render(true));
23
}));
24
}
25
}
26
27
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SleepResumeRepaintMinimap, LifecyclePhase.Eventually);
28
29