-
Notifications
You must be signed in to change notification settings - Fork 656
refactor(rome_formatter): new format API, part 2 #2038
Conversation
Parser conformance results on ubuntu-latestT262
TS
|
Deploying with
|
Latest commit: |
29f7641
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b44bc198.tools-8rn.pages.dev |
crates/rome_formatter/src/ts/statements/variable_declaration_statement.rs
Outdated
Show resolved
Hide resolved
@@ -14,6 +14,8 @@ class Foo extends Boar { | |||
|
|||
} | |||
|
|||
* generator (){} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This case was uncovered by our formatter and it was buggy. The new trait system worked quite well.
!bench_formatter |
Bench results on ubuntu-latest
|
crates/rome_formatter/src/ts/statements/variable_declaration_statement.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ematipico the benchmark output is no longer printed as a table which makes it hard to read the results. Would you mind having a look?
It was never printed as a markdown table (check the code), but just as simple block and a mix of tabs/spaces to make the formatting decent. I can change it make a markdown table if you want |
You're right. It also prints somewhat misaligned locally. I wonder why that is. Maybe there's some way to get the nice formatting back on console & PR comment. |
The output comes form critcmp, which is installed and run only during the CI. Unfortunately I don't see any markdown option. I guess the only solution would be to build our own. |
Summary
Part of #1996
This PR refactors more code to use the new format API.
While doing so, I encountered new edge cases, because of that I created new APIs for these cases:
try_format_with_or
which allow the use of the try operator inside the closurestry_format_with
which allow the use of the try operator inside the closuresI've also fixed some bug in the process.
Test Plan
Existing tests should not break