Sprint 280: Cross-language step + breakpoints (steps 1928–1932)
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>
This commit is contained in:
36
editor/src/CrossLanguageStepIntoHandler.h
Normal file
36
editor/src/CrossLanguageStepIntoHandler.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user