/
EvilBeaver
/
OneScript
Обзор
Документация
Войти
/
EvilBeaver
/
OneScript
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
v2.0.2
src/VSCode.DebugAdapter/ThreadStateContainer.cs
30 строк
1 KB
EvilBeaver
Рефакторинг контейнеров переменных
19 дек 2025, 12:19
19 дек 2025, 12:19
16e326b
Код
Авторство
О чём код?
/*---------------------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. ----------------------------------------------------------*/ using OneScript.DebugProtocol; namespace VSCode.DebugAdapter { public class ThreadStateContainer { private readonly Handles<StackFrame> _framesHandles = new Handles<StackFrame>(); private readonly Handles<IVariablesProvider> _variablesHandles = new Handles<IVariablesProvider>(); public void Reset() { _framesHandles.Reset(); _variablesHandles.Reset(); } public int RegisterFrame(StackFrame processFrame) => _framesHandles.Create(processFrame); public StackFrame GetFrameById(int id) => _framesHandles.Get(id, null); public int RegisterVariablesProvider(IVariablesProvider provider) => _variablesHandles.Create(provider); public IVariablesProvider GetVariablesProviderById(int id) => _variablesHandles.Get(id, null); } }