Skip to content

Commit

Permalink
Require fourmolu >= 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonchinn178 committed Aug 17, 2023
1 parent ee105ee commit a20ffc6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 80 deletions.
3 changes: 1 addition & 2 deletions plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ library
buildable: True
exposed-modules:
Ide.Plugin.Fourmolu
, Ide.Plugin.Fourmolu.Shim
hs-source-dirs: src
ghc-options: -Wall
build-depends:
, base >=4.12 && <5
, filepath
, fourmolu ^>=0.3 || ^>=0.4 || ^>= 0.6 || ^>= 0.7 || ^>= 0.8 || ^>= 0.9 || ^>= 0.10 || ^>= 0.11 || ^>= 0.12 || ^>= 0.13
, fourmolu ^>= 0.9 || ^>= 0.10 || ^>= 0.11 || ^>= 0.12 || ^>= 0.13
, ghc
, ghc-boot-th
, ghcide == 2.1.0.0
Expand Down
6 changes: 3 additions & 3 deletions plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import Development.IDE.GHC.Compat as Compat hiding (Cpp, Warning,
import qualified Development.IDE.GHC.Compat.Util as S
import GHC.LanguageExtensions.Type (Extension (Cpp))
import Ide.Plugin.Error
import Ide.Plugin.Fourmolu.Shim
import Ide.Plugin.Properties
import Ide.PluginUtils (makeDiffTextEdit)
import Ide.Types
Expand All @@ -43,6 +42,7 @@ import Language.LSP.Protocol.Message
import Language.LSP.Protocol.Types
import Language.LSP.Server hiding (defaultConfig)
import Ormolu
import Ormolu.Config
import System.Exit
import System.FilePath
import System.Process.Run (cwd, proc)
Expand Down Expand Up @@ -87,9 +87,9 @@ provider recorder plId ideState typ contents fp fo = ExceptT $ withIndefinitePro
where
printerOpts = cfgFilePrinterOpts fourmoluConfig
config =
addFixityOverrides (cfgFileFixities fourmoluConfig) $
defaultConfig
{ cfgDynOptions = map DynOption fileOpts
, cfgFixityOverrides = cfgFileFixities fourmoluConfig
, cfgRegion = region
, cfgDebug = False
, cfgPrinterOpts =
Expand All @@ -112,7 +112,7 @@ provider recorder plId ideState typ contents fp fo = ExceptT $ withIndefinitePro
}
throwError $ PluginInternalError errorMessage
where
errorMessage = "Failed to load " <> T.pack f <> ": " <> T.pack (showParseError err)
errorMessage = "Failed to load " <> T.pack f <> ": " <> T.pack (show err)
where
fp' = fromNormalizedFilePath fp
title = "Formatting " <> T.pack (takeFileName fp')
Expand Down
75 changes: 0 additions & 75 deletions plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu/Shim.hs

This file was deleted.

0 comments on commit a20ffc6

Please sign in to comment.