Skip to content

Commit c5d368a

Browse files
committed
Prevent fourmolu from getting editor's tabSize
1 parent ecafd3e commit c5d368a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

plugins/default/src/Ide/Plugin/Fourmolu.hs

+2-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import Control.Exception
1313
import Data.Either.Extra
1414
import System.FilePath
1515

16-
import Control.Lens ((^.))
1716
import qualified Data.Text as T
1817
import Development.IDE as D
1918
import qualified DynFlags as D
@@ -28,7 +27,6 @@ import Language.Haskell.LSP.Messages (FromServerMessage (ReqShowMessage))
2827
import Ide.Types
2928
import Language.Haskell.LSP.Core
3029
import Language.Haskell.LSP.Types
31-
import Language.Haskell.LSP.Types.Lens
3230
import "fourmolu" Ormolu
3331

3432
-- ---------------------------------------------------------------------
@@ -42,7 +40,7 @@ descriptor plId =
4240
-- ---------------------------------------------------------------------
4341

4442
provider :: FormattingProvider IO
45-
provider lf ideState typ contents fp fo = withIndefiniteProgress lf title Cancellable $ do
43+
provider lf ideState typ contents fp _ = withIndefiniteProgress lf title Cancellable $ do
4644
ghc <- runAction "Fourmolu" ideState $ use GhcSession fp
4745
fileOpts <- case hsc_dflags . hscEnv <$> ghc of
4846
Nothing -> return []
@@ -59,7 +57,7 @@ provider lf ideState typ contents fp fo = withIndefiniteProgress lf title Cancel
5957
, cfgDebug = True
6058
, cfgPrinterOpts =
6159
fillMissingPrinterOpts
62-
(lspPrinterOpts <> printerOpts)
60+
printerOpts
6361
defaultPrinterOpts
6462
}
6563

@@ -92,7 +90,6 @@ provider lf ideState typ contents fp fo = withIndefiniteProgress lf title Cancel
9290
where
9391
fp' = fromNormalizedFilePath fp
9492
title = "Formatting " <> T.pack (takeFileName fp')
95-
lspPrinterOpts = mempty{poIndentation = Just $ fo ^. tabSize}
9693
region = case typ of
9794
FormatText ->
9895
RegionIndices Nothing Nothing

0 commit comments

Comments
 (0)