hls-fourmolu-plugin 1.0.0.2 → 1.0.1.1
raw patch · 2 files changed
+24/−25 lines, 2 filesdep ~fourmoludep ~ghcidePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: fourmolu, ghcide
API changes (from Hackage documentation)
Files
- hls-fourmolu-plugin.cabal +5/−4
- src/Ide/Plugin/Fourmolu.hs +19/−21
hls-fourmolu-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-fourmolu-plugin-version: 1.0.0.2+version: 1.0.1.1 synopsis: Integration with the Fourmolu code formatter description: Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -19,13 +19,14 @@ library exposed-modules: Ide.Plugin.Fourmolu hs-source-dirs: src+ ghc-options: -Wall build-depends: , base >=4.12 && <5 , filepath- , fourmolu ^>=0.3+ , fourmolu ^>=0.3 || ^>=0.4 , ghc , ghc-boot-th- , ghcide >=1.2 && <1.5+ , ghcide >=1.2 && <1.6 , hls-plugin-api >=1.1 && <1.3 , lens , lsp@@ -38,7 +39,7 @@ default-language: Haskell2010 hs-source-dirs: test main-is: Main.hs- ghc-options: -threaded -rtsopts -with-rtsopts=-N+ ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: , base , filepath
src/Ide/Plugin/Fourmolu.hs view
@@ -8,22 +8,20 @@ provider, ) where -import Control.Exception (try)-import Control.Lens ((^.))+import Control.Exception (try)+import Control.Lens ((^.)) import Control.Monad.IO.Class-import Data.Bifunctor (first)-import qualified Data.Text as T-import Development.IDE hiding (pluginHandlers)-import Development.IDE.GHC.Compat (moduleNameString)-import qualified DynFlags as D-import qualified EnumSet as S-import GHC.LanguageExtensions.Type (Extension (Cpp))-import GhcPlugins (HscEnv (hsc_dflags))-import Ide.PluginUtils (makeDiffTextEdit)+import Data.Bifunctor (first)+import qualified Data.Text as T+import Development.IDE hiding (pluginHandlers)+import Development.IDE.GHC.Compat as Compat hiding (Cpp)+import qualified Development.IDE.GHC.Compat.Util as S+import GHC.LanguageExtensions.Type (Extension (Cpp))+import Ide.PluginUtils (makeDiffTextEdit) import Ide.Types-import Language.LSP.Server hiding (defaultConfig)+import Language.LSP.Server hiding (defaultConfig) import Language.LSP.Types-import Language.LSP.Types.Lens+import Language.LSP.Types.Lens (HasTabSize (tabSize)) import Ormolu import System.FilePath @@ -71,10 +69,10 @@ format mempty ConfigParseError f (_, err) -> do sendNotification SWindowShowMessage $- ShowMessageParams- { _xtype = MtError- , _message = errorMessage- }+ ShowMessageParams+ { _xtype = MtError+ , _message = errorMessage+ } return . Left $ responseError errorMessage where errorMessage = "Failed to load " <> T.pack f <> ": " <> T.pack err@@ -88,12 +86,12 @@ FormatRange (Range (Position sl _) (Position el _)) -> RegionIndices (Just $ sl + 1) (Just $ el + 1) -convertDynFlags :: D.DynFlags -> IO [DynOption]+convertDynFlags :: DynFlags -> IO [DynOption] convertDynFlags df = let pp = ["-pgmF=" <> p | not (null p)]- p = D.sPgm_F $ D.settings df- pm = map (("-fplugin=" <>) . moduleNameString) $ D.pluginModNames df- ex = map showExtension $ S.toList $ D.extensionFlags df+ p = sPgm_F $ Compat.settings df+ pm = map (("-fplugin=" <>) . moduleNameString) $ pluginModNames df+ ex = map showExtension $ S.toList $ extensionFlags df showExtension = \case Cpp -> "-XCPP" x -> "-X" ++ show x