-
Notifications
You must be signed in to change notification settings - Fork 667
feat(rome_js_parser): optional variance annotation #2556
feat(rome_js_parser): optional variance annotation #2556
Conversation
!bench_parser |
Parser Benchmark Results
|
This pull request is pretty big, so I prefer to separate the |
@MichaReiser , @ematipico could we make some progress here ? Since prettier has been landed Ts 4.7, prettier/prettier#12900 |
}) | ||
.parse_exclusive_syntax( | ||
p, | ||
|p| parse_ts_type_parameters(p, true), |
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.
I find true
/false
parameters hard to understand. Having a parse_ts_type_parameters_impl
function that takes a boolean parameter is fine but I would probably expose a parse_ts_type_parameters
and a ts_type_parameters_with_modifiers
function instead to make the difference clear.
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.
The only thing I want to argue is that the only difference between parse_ts_type_parameters_impl
and parse_ts_type_parameters
would be https://github.com/IWANABETHATGUY/tools/blob/d8dd387ec11b49fe46da005c53f7ed17aa34e387/crates/rome_js_parser/src/syntax/typescript/types.rs#L110-L111, Is this duplication acceptable ?
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.
@MichaReiser, any thought about this?
crates/rome_js_parser/test_data/inline/ok/type_parameter_modifier_tsx.tsx
Outdated
Show resolved
Hide resolved
…ETHATGUY/tools into feat/optional-variance-annotation
Summary
part of #2400
current:
File Based Average Prettier Similarity: 72.69%
Line Based Average Prettier Similarity: 67.25%
main:
File Based Average Prettier Similarity: 72.65%
Line Based Average Prettier Similarity: 67.13%
Test Plan
I took test cases from esbuild evanw/esbuild#2102, the original test case of Typescript pull request related to semantics, which we don't care too much about. esbuild
Optional variance annotations
pull request test case is more suitable for us.