Closed
Description
hideImplicitPreludeSymbol
, or newImport
which I factored out in #1428, is really weird in my opinion. The goal is simple: to insert an import declaration, but it's a little bit tedious to express this in Rewrite
-- we concatenate strings manually, parse it, adjust its annotations, and finally print it with exactPrint
, which is kinda going round. Moreover, I don't think it accords with the semantic of rewriting ASTs: it rewrites nothing, but returns a new AST. The true rewriting in this case should be appending the new import declaration into the end of hsmodDecls
, a part of HsModule
, but it seems less resonable as well, so TextEdit
could be the solution. I plan to remove newImport
in my next PR.
Originally posted in #1512