Skip to content

#2346 redone: a formatter for Rascal itself, plus the necessary improvements and stabilization in the Box formatter framework code.#2738

Open
jurgenvinju wants to merge 20 commits intomainfrom
second-try-rascal-formatter
Open

#2346 redone: a formatter for Rascal itself, plus the necessary improvements and stabilization in the Box formatter framework code.#2738
jurgenvinju wants to merge 20 commits intomainfrom
second-try-rascal-formatter

Conversation

@jurgenvinju
Copy link
Copy Markdown
Member

@jurgenvinju jurgenvinju commented Mar 31, 2026

This is a redo of #2346 which was mangled due to a wrong use of git-filter-repo.

Rascal is a pretty big language so this pushes the new toBox and format and layoutDiff functions to the max.

  • The goal is to formulate toBox rules such that the formatter produces beautiful layout, and
  • We identify bugs and efficiency issues in toBox, format and layoutDiff and fix them immediately.
  • We add box operators with variable argument lists to eliminate a level of superfluous brackets
  • We test for exceptions, parse errors and comment preservation, on all files of the standard library and the larger files in the Compiler and checker.
  • re-implementation (optimized) of U and G
  • integration tests succeed https://github.com/usethesource/rascal-core-big-tests/actions/runs/23592431666

@jurgenvinju jurgenvinju changed the title Another clean PR branch to work with for the formatter" Redo #2346 formatter branch Mar 31, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46%. Comparing base (f6d6bbe) to head (d0d02e0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2738   +/-   ##
=======================================
  Coverage       46%     46%           
- Complexity    6725    6732    +7     
=======================================
  Files          794     794           
  Lines        65923   65936   +13     
  Branches      9888    9888           
=======================================
+ Hits         30837   30853   +16     
+ Misses       32696   32693    -3     
  Partials      2390    2390           

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

Comment thread src/org/rascalmpl/library/analysis/diff/edits/ExecuteTextEdits.rsc Outdated
Comment thread src/org/rascalmpl/library/analysis/diff/edits/HiFiLayoutDiff.rsc Outdated
Comment thread src/org/rascalmpl/library/lang/rascal/format/Rascal.rsc Outdated
Comment thread src/org/rascalmpl/library/lang/rascal/grammar/definition/Priorities.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Highlight.rsc
Comment thread src/org/rascalmpl/library/IO.rsc Outdated
Comment thread src/org/rascalmpl/library/util/Monitor.rsc
Comment thread src/org/rascalmpl/library/List.rsc
Comment thread src/org/rascalmpl/library/Type.rsc
@jurgenvinju
Copy link
Copy Markdown
Member Author

jurgenvinju commented Apr 19, 2026

thanks for the review @toinehartman . Before we merge, some of the TODOs @toinehartman highlighted should be checked. See the conversation above.

@sonarqubecloud
Copy link
Copy Markdown

@jurgenvinju jurgenvinju changed the title Redo #2346 formatter branch #2346 redone: a formatter for Rascal itself, plus the necessary improvements and stabilization in the Box formatter framework code. Apr 20, 2026
@jurgenvinju jurgenvinju self-assigned this Apr 21, 2026
@jurgenvinju
Copy link
Copy Markdown
Member Author

@DavyLandman this seems ready. lots of fixes in Box-related code, fixed in layoutDif, and new features for Rascal formatting.

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