Fix do let comment indentation problems
parent
0a41843efd
commit
55709c9b17
|
@ -627,3 +627,13 @@ regressionTests = do
|
||||||
RepoLocal { abc } -> return ()
|
RepoLocal { abc } -> return ()
|
||||||
RepoLocal{} -> 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")
|
(docLit $ Text.pack "let")
|
||||||
(docSetIndentLevel $ return bindDoc)
|
(docSetIndentLevel $ return bindDoc)
|
||||||
]
|
]
|
||||||
Just bindDocs@(bindDoc1:bindDocr) -> do
|
Just bindDocs -> docAlt
|
||||||
-- TODO: the indentation here is screwed up. needs docSetIndentLevel and
|
[ docSeq
|
||||||
-- SetBaseY based layouting, not cols.
|
|
||||||
docSetBaseY $ docAlt
|
|
||||||
[ docLines
|
|
||||||
$ (docCols ColDoLet
|
|
||||||
[ appSep $ docLit $ Text.pack "let"
|
[ appSep $ docLit $ Text.pack "let"
|
||||||
, docSetIndentLevel $ return bindDoc1
|
, docSetIndentLevel $ docLines $ return <$> bindDocs
|
||||||
])
|
]
|
||||||
: (bindDocr <&> \bindDoc ->
|
|
||||||
docCols ColDoLet
|
|
||||||
[ docEnsureIndent (BrIndentSpecial 4) docEmpty
|
|
||||||
, docSetIndentLevel $ return bindDoc
|
|
||||||
])
|
|
||||||
, docAddBaseY BrIndentRegular
|
, docAddBaseY BrIndentRegular
|
||||||
$ docPar
|
$ docPar
|
||||||
(docLit $ Text.pack "let")
|
(docLit $ Text.pack "let")
|
||||||
|
|
Loading…
Reference in New Issue