#pragma once #include "PolyglotStackTraceDecoder.h" #include "DebugAdapterRouter.h" #include #include namespace whetstone { struct StepIntoResult { bool switched = false; std::string previousLanguage; std::string newLanguage; int targetFrameId = -1; }; class CrossLanguageStepIntoHandler { public: // Step-into at a boundary: switch active adapter to the next frame's language. StepIntoResult stepInto(const StackFrame& frame, DebugAdapterRouter& router, const std::vector& frames, int frameIndex) const { int next = frameIndex + 1; if (!frame.isBoundary || next >= static_cast(frames.size()) || frames[next].language == frame.language) return {false, "", "", -1}; std::string prev = router.getActiveLanguage(); std::string newLang = frames[next].language; router.setActiveLanguage(newLang); return {true, prev, newLang, frames[next].id}; } }; } // namespace whetstone