You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
hideImplicitPreludeSymbol
, ornewImport
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 inRewrite
-- we concatenate strings manually, parse it, adjust its annotations, and finally print it withexactPrint
, 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 ofhsmodDecls
, a part ofHsModule
, but it seems less resonable as well, soTextEdit
could be the solution. I plan to removenewImport
in my next PR.Originally posted in #1512
The text was updated successfully, but these errors were encountered: