Fix do let comment indentation problems
parent
0a41843efd
commit
55709c9b17
|
@ -627,3 +627,13 @@ regressionTests = do
|
|||
RepoLocal { abc } -> return ()
|
||||
RepoLocal{} -> return ()
|
||||
|]
|
||||
it "do let comment indentation level problem" $ do
|
||||
roundTripEqual $
|
||||
[text|
|
||||
func = do
|
||||
let (primaryPkg, otherPkgs) = selectPrimaryLocalPackage pwd pkgs'
|
||||
(bproblems, x) = resolveBuildTargets primaryPkg otherPkgs utargets''
|
||||
-- default local dir target if there's no given target
|
||||
utargets'' = "foo"
|
||||
return ()
|
||||
|]
|
||||
|
|
|
@ -62,20 +62,11 @@ layoutStmt lstmt@(L _ stmt) = docWrapNode lstmt $ case stmt of
|
|||
(docLit $ Text.pack "let")
|
||||
(docSetIndentLevel $ return bindDoc)
|
||||
]
|
||||
Just bindDocs@(bindDoc1:bindDocr) -> do
|
||||
-- TODO: the indentation here is screwed up. needs docSetIndentLevel and
|
||||
-- SetBaseY based layouting, not cols.
|
||||
docSetBaseY $ docAlt
|
||||
[ docLines
|
||||
$ (docCols ColDoLet
|
||||
Just bindDocs -> docAlt
|
||||
[ docSeq
|
||||
[ appSep $ docLit $ Text.pack "let"
|
||||
, docSetIndentLevel $ return bindDoc1
|
||||
])
|
||||
: (bindDocr <&> \bindDoc ->
|
||||
docCols ColDoLet
|
||||
[ docEnsureIndent (BrIndentSpecial 4) docEmpty
|
||||
, docSetIndentLevel $ return bindDoc
|
||||
])
|
||||
, docSetIndentLevel $ docLines $ return <$> bindDocs
|
||||
]
|
||||
, docAddBaseY BrIndentRegular
|
||||
$ docPar
|
||||
(docLit $ Text.pack "let")
|
||||
|
|
Loading…
Reference in New Issue