@@ -32,7 +32,7 @@ import Ormolu.Parser.Anns
3232import Ormolu.Parser.CommentStream
3333import Ormolu.Parser.Result
3434import Ormolu.Processing.Preprocess (preprocess)
35−import Ormolu.Utils (incSpanLine)
35+import Ormolu.Utils (incSpanLine, removeIndentation)
3636import qualified Panic as GHC
3737import qualified Parser as GHC
3838import qualified StringBuffer as GHC
@@ -51,8 +51,9 @@ parseModule ::
5151 Either (SrcSpan, String) ParseResult
5252 )
5353parseModule Config {..} path rawInput = liftIO $ do
54− let (literalPrefix, input, literalSuffix, extraComments) =
54+ let (literalPrefix, indentedInput, literalSuffix, extraComments) =
5555 preprocess path rawInput cfgRegion
56+ (input, indent) = removeIndentation indentedInput
5657 -- It's important that 'setDefaultExts' is done before
5758 -- 'parsePragmasIntoDynFlags', because otherwise we might enable an
5859 -- extension that was explicitly disabled in the file.
@@ -110,7 +111,8 @@ parseModule Config {..} path rawInput = liftIO $ do
110111 prImportQualifiedPost =
111112 GHC.xopt ImportQualifiedPost dynFlags,
112113 prLiteralPrefix = T.pack literalPrefix,
113− prLiteralSuffix = T.pack literalSuffix
114+ prLiteralSuffix = T.pack literalSuffix,
115+ prIndent = indent
114116 }
115117 return (warnings, r)
116118