mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-21 15:28:15 +03:00
automatically run ormolu
This commit is contained in:
parent
6d627d791c
commit
90ade2dcd1
@ -173,8 +173,8 @@ data DocLiteralContext
|
||||
|
||||
-}
|
||||
|
||||
isBindingSoftHangable :: (Var v) => Term2 v at ap v a -> Bool
|
||||
isBindingSoftHangable (isSoftHangable -> True) = True
|
||||
isBindingSoftHangable :: (Var v) => Term2 v at ap v a -> Bool
|
||||
isBindingSoftHangable (isSoftHangable -> True) = True
|
||||
isBindingSoftHangable (Apps' _ (unsnoc -> Just (_, last))) = isSoftHangable last
|
||||
isBindingSoftHangable _ = False
|
||||
|
||||
@ -185,14 +185,14 @@ pretty0 ::
|
||||
Term3 v PrintAnnotation ->
|
||||
m (Pretty SyntaxText)
|
||||
pretty0 a tm | precedence a == -2 && not (isBindingSoftHangable tm) = do
|
||||
-- precedence = -2 means this is a top level binding, and we allow
|
||||
-- precedence = -2 means this is a top level binding, and we allow
|
||||
-- use clause insertion here even when it otherwise wouldn't be
|
||||
-- (as long as the tm isn't soft hangable, if it gets soft hung then
|
||||
-- adding use clauses beforehand will mess things up)
|
||||
tmp <- pretty0 (a { imports = im, precedence = -1 }) tm
|
||||
tmp <- pretty0 (a {imports = im, precedence = -1}) tm
|
||||
pure $ PP.lines (uses <> [tmp])
|
||||
where
|
||||
(im, uses) = calcImports (imports a) tm
|
||||
(im, uses) = calcImports (imports a) tm
|
||||
pretty0
|
||||
a@AmbientContext
|
||||
{ precedence = p,
|
||||
|
Loading…
Reference in New Issue
Block a user