Path: blob/main/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContextRegistry.ts
4780 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 { TextAreaEditContext } from './textAreaEditContext.js';78class TextAreaEditContextRegistryImpl {910private _textAreaEditContextMapping: Map<string, TextAreaEditContext> = new Map();1112register(ownerID: string, textAreaEditContext: TextAreaEditContext): IDisposable {13this._textAreaEditContextMapping.set(ownerID, textAreaEditContext);14return {15dispose: () => {16this._textAreaEditContextMapping.delete(ownerID);17}18};19}2021get(ownerID: string): TextAreaEditContext | undefined {22return this._textAreaEditContextMapping.get(ownerID);23}24}2526export const TextAreaEditContextRegistry = new TextAreaEditContextRegistryImpl();272829