Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For exactprint 1.5.0 / ghc-9.2.5, makeDeltaAst' seems to just break things #118

Open
lspitzner opened this issue Dec 20, 2022 · 0 comments

Comments

@lspitzner
Copy link
Contributor

I am trying to exactprint individual decls. On the untransformed parsed source, exactprinting one decl works, but it inserts newlines corresponding to the position of the decl in the original source file, i.e. if you have

> module Foo where
> 
> import Prelude
> 
> blah :: Int

and if you pretty-print just the type signature you get

> 
> 
> 
> 
> blah :: Int

which is a bit annoying/confusing. Trying to solve this I thought I'd be able to make use of the makeDeltaAst helper, but with that, things completely break, and you get output similar to (not exactly with the above input, but the problem should be apparent):

       from anc:Anchor local/Sample.hs:7:8-10 UnchangedAnchor
 EpAnnNotUsed:from anc:Anchor local/Sample.hs:8:1-3 UnchangedAnchorEpAnnNotUsed:from anc:Anchor local/Sample.hs:8:1-8 UnchangedAnchorEpAnnNotUsed:from anc:Anchor local/Sample.hs:8:1-8 UnchangedAnchorfoo =EpAnnNotUsed:from anc:Anchor local/Sample.hs:8:1-3 UnchangedAnchor      42






      from anc:Anchor local/Sample.hs:8:7-8 UnchangedAnchor

Is that function just broken? Intended for a different purpose? Is it meant to be applied recursively? Fixed in 9.4.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant