Skip to content

Redo #2346 formatter branch#2738

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

Redo #2346 formatter branch#2738
jurgenvinju wants to merge 12 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

@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 (53d2faa) to head (914b6a7).

Additional details and impacted files
@@           Coverage Diff           @@
##              main   #2738   +/-   ##
=======================================
- Coverage       46%     46%   -1%     
+ Complexity    6737    6732    -5     
=======================================
  Files          794     794           
  Lines        65923   65936   +13     
  Branches      9888    9888           
=======================================
+ Hits         30858   30861    +3     
- Misses       32684   32687    +3     
- Partials      2381    2388    +7     

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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 7, 2026

assert isSorted(edits, less=bool (TextEdit e1, TextEdit e2) {
return e1.range.offset < e2.range.offset;
});
// assert isSorted(edits, less=bool (TextEdit e1, TextEdit e2) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Commented code: can we remove this?

@@ -27,6 +27,8 @@ module analysis::diff::edits::HiFiLayoutDiff
extend analysis::diff::edits::HiFiTreeDiff;
import ParseTree; // this should not be necessary because imported by HiFiTreeDiff
import String; // this should not be be necessary because imported by HiFiTreeDiff
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this indicate a type-checker bug? Has this already been solved in a RC of the extension?

L("\<:"),
toBox(bound));

// TODO: put these functions on top after the function cache issue has been resolved:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this still relevant?


private Symbol strip(label(_, Symbol s)) = strip(s);
private Symbol strip(conditional(Symbol s, _)) = strip(s);
default Symbol strip(Symbol s) = s; No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be private as well?

}

@synopsis{Yields the characters of a parse tree as the original input sentence in a <code>...</code> block, but with spans for highlighted segments in HTML}
public str toHTML(Tree t) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This removes a public stdlib definition. Is this supposed to be replaced by the renamed definition (ToHTML => toHTML) higher up in this file?

See ((IO-iprint)) for a version that displays the result on the console
and ((IO-iprintExp)) for a version that returns its argument as result
and ((IO-iprintln)) for a version that adds a newline.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this empty line intentional?

}

@synopsis{Convenience function for reporting progress on a for loop over a set, with a list of results.}
list[&U] loopJob(set[&T] work, &U(&T) consumer, str label = "", str (&T) stepLabel = str(&T w) { return "<w>"; }) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why a list of results instead of a set?

(isEmpty(xs))? [] : ([head(xs)] | it + [sep,x] | x <- tail(xs));

list[&T] intersperse(&T sep, list[&T] xs) =
[x, sep | &T x <- xs][..-1];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Much better 👍

* Type inference has a guaranteed least or greatest solution, always. This means that constraints are always solvable in an unambiguous manner.
* A _principal type_ can always be computed, which is a most precise and unique solution of a type inference problem. Without the lattice, solution candidates could become incomparable and thus ambiguous. Without
this principal type property, type inference is predictable for programmers.
this principal type property, type inference is unpredictable for programmers.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That's quite the difference 😄

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