Skip to content

Conversation

@jbdoderlein
Copy link
Contributor

This is a first implementation for DAP exception breakpoint.

It define a "Rascal Exception" breakpoint in the DAP :
image

When activated, instead of simply displaying the exception to REPL, it stop the evaluator on the exception and trigger a breakpoint with exception information. The exception message is displayed inline at the location of the exception :

image

Since the evaluator is stopped, the context of the exception is still accessible (e.g. variables). When #2523 will be merged, the user could interact with the evaluator in this suspended state.

When the debugger is resumed, the exception is then displayed in the REPL.

TODO/Question :

  • For now, the notification is sended in RascalFunction evaluation function, which lead to some exception missing some information (CallFailed Exception is generated later, here we catch only a MatchFail exception which lack informations)
  • Integrate with Evaluation dap #2523
  • We could propose the same debug filter as Java DAP with Caught and Uncaught Exception, but this feature seems harder to implement and less usefull.

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

❌ Patch coverage is 13.33333% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 47%. Comparing base (8f12439) to head (9066737).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/org/rascalmpl/dap/RascalDebugAdapter.java 0% 12 Missing ⚠️
src/org/rascalmpl/debug/DebugHandler.java 0% 10 Missing ⚠️
src/org/rascalmpl/dap/RascalDebugEventTrigger.java 0% 8 Missing ⚠️
src/org/rascalmpl/interpreter/Evaluator.java 37% 4 Missing and 1 partial ⚠️
...scalmpl/debug/AbstractInterpreterEventTrigger.java 0% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2543   +/-   ##
=======================================
- Coverage       47%     47%   -1%     
+ Complexity    6714    6703   -11     
=======================================
  Files          792     792           
  Lines        65342   65385   +43     
  Branches      9784    9788    +4     
=======================================
+ Hits         30938   30943    +5     
- Misses       31984   32023   +39     
+ Partials      2420    2419    -1     

☔ 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.

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.

1 participant