sorawee / fmt

A code formatter for Racket
Other
72 stars 6 forks source link

Long hash expressions linebreak inconveniently #57

Open jackfirth opened 1 month ago

jackfirth commented 1 month ago

fmt currently changes this code:

(define formulas
  (hash 'water (list 'hydrogen 'oxygen)
        'benzene (list 'hydrogen 'carbon)
        'glucose (list 'hydrogen 'oxygen 'carbon)))

into this:

(define formulas
  (hash 'water
        (list 'hydrogen 'oxygen)
        'benzene
        (list 'hydrogen 'carbon)
        'glucose
        (list 'hydrogen 'oxygen 'carbon)))

This is unfortunate. Perhaps treat hash expressions and other similarly shaped built-ins with some special logic? However, that wouldn't work for my sorted maps in Rebellion, which face the same issue.