CrossLanguageStepOverHandler, CrossLanguageStepIntoHandler, ASTNodeBreakpointMapper, BreakpointSyncOrchestrator — 26/26 tests pass. Integration step 1932: Go+TypeScript poly-API round-trip verified. Metrics: 7 whetstone calls, 5587 tokens. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#pragma once
|
|
#include "PolyglotStackTraceDecoder.h"
|
|
#include "DebugAdapterRouter.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
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<StackFrame>& frames,
|
|
int frameIndex) const {
|
|
int next = frameIndex + 1;
|
|
if (!frame.isBoundary ||
|
|
next >= static_cast<int>(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
|