Path: blob/main/src/vs/editor/browser/controller/editContext/native/nativeEditContextRegistry.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 { IDisposable } from '../../../../../base/common/lifecycle.js';6import { NativeEditContext } from './nativeEditContext.js';78class NativeEditContextRegistryImpl {910private _nativeEditContextMapping: Map<string, NativeEditContext> = new Map();1112register(ownerID: string, nativeEditContext: NativeEditContext): IDisposable {13this._nativeEditContextMapping.set(ownerID, nativeEditContext);14return {15dispose: () => {16this._nativeEditContextMapping.delete(ownerID);17}18};19}2021get(ownerID: string): NativeEditContext | undefined {22return this._nativeEditContextMapping.get(ownerID);23}24}2526export const NativeEditContextRegistry = new NativeEditContextRegistryImpl();272829