Path: blob/main/src/vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { LifecyclePhase } from '../../../services/lifecycle/common/lifecycle.js';6import { Registry } from '../../../../platform/registry/common/platform.js';7import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from '../../../common/contributions.js';8import { ICodeEditorService } from '../../../../editor/browser/services/codeEditorService.js';9import { INativeHostService } from '../../../../platform/native/common/native.js';10import { Disposable } from '../../../../base/common/lifecycle.js';1112class SleepResumeRepaintMinimap extends Disposable implements IWorkbenchContribution {1314constructor(15@ICodeEditorService codeEditorService: ICodeEditorService,16@INativeHostService nativeHostService: INativeHostService17) {18super();1920this._register(nativeHostService.onDidResumeOS(() => {21codeEditorService.listCodeEditors().forEach(editor => editor.render(true));22}));23}24}2526Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(SleepResumeRepaintMinimap, LifecyclePhase.Eventually);272829