You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is the initial codeletfoo= {a: [@hey] a};letfoo= {a:a, b:b, c:c, d: [@hey] d};// Turns into the below after refmtletfoo= {d: [@hey] d};letfoo= {
a,
b,
c,
d,
};
On those cases, I think we can keep the prop without shorthand:
// This is the initial codeletbar= <button onFocus={onFocus} onClick={[@foo] onClick} />
letfoo= {a:a, b:b, c:c, d: [@hey] d}
// Turns into the below after refmtletbar= <button onFocus onClick={[@foo] onClick} />
letfoo= {
a,
b,
c,
d: [@hey] d
};
Record
Gravacao.de.Tela.2025-01-06.as.11.46.17.mov
The text was updated successfully, but these errors were encountered:
ocamlformat would never do such a thing, it checks that you get the same AST before and after formatting (ignoring locations). Such a bug would be possible, but it would result in ocamlformat crashing. Maybe the same needs to be added to refmt ?
Description
I was trying to use ppx attributes on prop variables with the exact name of the prop itself, but the refmt converts it to a shorthand value
<button onFocus={onFocus} onClick={[@foo] onClick} />
becomes<button onFocus onClick/>
The same happens to long records
We can see that it happens only on reason:
Access this playground sample
Click on
format
Check the refmt makes
baz
as shorthand on both components and the long record.Access the ocaml version of this code
Click on
format
Check that nothing happens.
Solution
On those cases, I think we can keep the prop without shorthand:
Record
Gravacao.de.Tela.2025-01-06.as.11.46.17.mov
The text was updated successfully, but these errors were encountered: