Skip to content

Conversation

@jbdoderlein
Copy link
Contributor

Add restart frame support to the DAP.

Demo :

restartframe.mp4

@codecov
Copy link

codecov bot commented Dec 31, 2025

Codecov Report

❌ Patch coverage is 51.16279% with 63 lines in your changes missing coverage. Please review.
✅ Project coverage is 46%. Comparing base (dd31794) to head (811a7bd).

Files with missing lines Patch % Lines
...g/rascalmpl/interpreter/result/RascalFunction.java 70% 18 Missing and 9 partials ⚠️
src/org/rascalmpl/dap/RascalDebugAdapter.java 0% 11 Missing ⚠️
src/org/rascalmpl/debug/DebugHandler.java 0% 10 Missing ⚠️
src/org/rascalmpl/dap/RascalDebugEventTrigger.java 0% 7 Missing ⚠️
...eter/control_exceptions/RestartFrameException.java 0% 4 Missing ⚠️
...scalmpl/debug/AbstractInterpreterEventTrigger.java 0% 2 Missing ⚠️
src/org/rascalmpl/debug/DebugMessageFactory.java 0% 1 Missing ⚠️
src/org/rascalmpl/debug/IDebugMessage.java 0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2582   +/-   ##
=======================================
- Coverage       46%     46%   -1%     
+ Complexity    6631    6626    -5     
=======================================
  Files          793     794    +1     
  Lines        65623   65671   +48     
  Branches      9828    9836    +8     
=======================================
  Hits         30485   30485           
- Misses       32782   32826   +44     
- Partials      2356    2360    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@DavyLandman DavyLandman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly fine, I have one place where I want to ask @jurgenvinju to take a look once he's back.

Comment on lines +365 to +382
// Handle frame restart at this level
// Restore environment state and retry execution
// Continue the while loop to retry the call
if(ctx instanceof Evaluator) {
Evaluator evaluator = (Evaluator) ctx;
var stackTrace = evaluator.getCurrentStack();
if(stackTrace.size() == 1){ // should not happen because this is the REPL frame
throw new ImplementationError("Cannot restart frame of the REPL");
}
if (rfe.getTargetFrameId() == stackTrace.size() -1) { // the frame to restart
restartFrame = true;
continue; // restart the frame by continuing the while loop
}
else { // not the frame to restart, rethrow to let upper frames handle it
throw rfe;
}
}
throw new ImplementationError("Frame restart is only supported in Evaluator contexts");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is something for @jurgenvinju to review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants