Conversation
ff91945 to
9f5c415
Compare
|
Can you add a changelog entry? |
|
Could you remove the unrelated changes in belt_HashSetString.resi and belt_HashSetInt.resi? |
An attribute somehow might actually be beneficial for the editor tooling, if we want to do typed completion for values for instance. |
|
@zth aren't the rules the same as |
|
I'm also curious for the use case of the editor tooling =D Wouldn't we want to upgrade codebases automatically through the formatter? |
|
Just noting #6617 supports spread syntax if you want to vendor anything across. |
|
@bloodyowl What's the status of this PR? Would be great to get this feature merged! |
|
Yes, I agree. This would be a cool feature to have. |
| (Ast_helper.Exp.ident ~loc | ||
| (Location.mkloc | ||
| (Longident.Ldot | ||
| (Longident.Ldot (Longident.Lident "Js", "Dict"), "fromArray")) |
There was a problem hiding this comment.
Right, but this can be done independently later.
|
@zth Rebased |
This PR adds basic support for the
dict{}literal syntax (#6545).Parsing
Semantics within the braces are similar to the record with string keys (as dict keys can be any string).
It then turns
dict{"foo": "bar"}intoJs.Dict.fromArray([("foo", "bar")]).Printing
Any
Js.Dict.fromArraycall that contains a literal array of tuples (with no spread) is now printed asdict{...}.I think this change is safe for the upcoming stdlib change (that'll move
Js.DictintoDict) as the change will be invisible once using this syntax. If that's something we don't want, we can add an attribute when parsing adict{}expression so that we only print those back and leaveJs.Dict.fromArraycalls.