rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Weird formatting when coercing types with `:>`

Open fhammerschmidt opened this issue 1 year ago • 2 comments

This line is 105 characters long so it should break before the ->LongModuleName.longFunctionName, but it does not.

(LongModuleName.makeNoParams() :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName

This one breaks between the parameters of the make function:

// Before formatting
(LongModuleName.make(  ~a=1,  ~b="",) :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName

// After formatting
(LongModuleName.make(
  ~a=1,
  ~b="",
) :> LongModuleName.subTypeOfLongTypeName)->LongModuleName.longFunctionName

Playground link

fhammerschmidt avatar Nov 25 '24 11:11 fhammerschmidt

Also, it seems strange to have trailing comma for the function arguments (LongModuleName.make( ~a=1, ~b="",))

shulhi avatar Nov 25 '24 12:11 shulhi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 21 '25 02:11 github-actions[bot]