Skip to content

Make all CallOrTree expressions breakable#2761

Open
jbdoderlein wants to merge 1 commit intousethesource:mainfrom
jbdoderlein:nested-call-step-in
Open

Make all CallOrTree expressions breakable#2761
jbdoderlein wants to merge 1 commit intousethesource:mainfrom
jbdoderlein:nested-call-step-in

Conversation

@jbdoderlein
Copy link
Copy Markdown
Contributor

This PR is upgraded implementation of the one proposed in #2760

It makes CallOrTree breakable but does not add an extra step on expression that are statement.
It allows to step in and step over the different nested call of an expression. The only difference compared to other GPL debuggers is that step out of the last nested call does not allow to step in the root call.

stepinout.mp4

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 46%. Comparing base (f6d6bbe) to head (3515a76).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/org/rascalmpl/ast/Expression.java 0% 1 Missing ⚠️
src/org/rascalmpl/ast/Statement.java 0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2761   +/-   ##
=======================================
- Coverage       46%     46%   -1%     
+ Complexity    6725    6719    -6     
=======================================
  Files          794     794           
  Lines        65923   65924    +1     
  Branches      9888    9889    +1     
=======================================
- Hits         30837   30833    -4     
- Misses       32696   32705    +9     
+ Partials      2390    2386    -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.

@jurgenvinju
Copy link
Copy Markdown
Member

Hi JB! Thanks for this

@jurgenvinju
Copy link
Copy Markdown
Member

jurgenvinju commented Apr 18, 2026

The changes are in generated code, which is overwritten every time we fix something in the grammar. The isBteakable method overrides are also generated from the grammar.

To fix:

  • add the @Breakable tag to the callOrTree rule in lang::rascal::syntax::Rascal
  • Load lang::rascal::grammar::Bootstrap in a terminal
  • Call bootstrap(|project://rascal|) or any other uri to the root of the Rascal project clone
  • Both the parser and the AST are regenerated. Both need to be committed. The have to co-evolve.

I think this is the best way. There are alternatives but they'd make future understanding and maintenance more complex.

Groetjes!

@jbdoderlein
Copy link
Copy Markdown
Contributor Author

Hi, thank you for the response !

I have two questions:

  • Must the PR include all regenerated AST files? Non-impacted AST files seem to change only the constant in the hash function.
  • For the solution to work, the isBreakable in Sttement that are Expression need to be true only under certain conditions (here, !this.expression.isCallOrTree()). Is there a clean way to do that ? Another option is to move this logic into the debugger code.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants