packages feed

hls-floskell-plugin 2.5.0.0 → 2.6.0.0

raw patch · 2 files changed

+14/−11 lines, 2 filesdep ~floskelldep ~ghcidedep ~hls-plugin-apiPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: floskell, ghcide, hls-plugin-api, hls-test-utils

API changes (from Hackage documentation)

Files

hls-floskell-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4 name:               hls-floskell-plugin-version:            2.5.0.0+version:            2.6.0.0 synopsis:           Integration with the Floskell code formatter description:   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -21,16 +21,16 @@     location: https://github.com/haskell/haskell-language-server.git  library-  -- Plugins that need exactprint have not been updated for 9.8 yet-  if impl(ghc >= 9.5)+  -- floskell does not support GHC 9.8 yet+  if impl(ghc >= 9.7)     buildable: False   exposed-modules:  Ide.Plugin.Floskell   hs-source-dirs:   src   build-depends:     , base            >=4.12 && <5-    , floskell        ^>=0.10-    , ghcide          == 2.5.0.0-    , hls-plugin-api  == 2.5.0.0+    , floskell        ^>=0.11.0+    , ghcide          == 2.6.0.0+    , hls-plugin-api  == 2.6.0.0     , lsp-types       ^>=2.1     , mtl     , text@@ -39,7 +39,7 @@   default-language: Haskell2010  test-suite tests-  if impl(ghc >= 9.5)+  if impl(ghc >= 9.7)     buildable: False   type:             exitcode-stdio-1.0   default-language: Haskell2010@@ -50,4 +50,4 @@     , base     , filepath     , hls-floskell-plugin-    , hls-test-utils       == 2.5.0.0+    , hls-test-utils       == 2.6.0.0
src/Ide/Plugin/Floskell.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP               #-} {-# LANGUAGE OverloadedStrings #-}  module Ide.Plugin.Floskell@@ -20,9 +21,11 @@ -- ---------------------------------------------------------------------  descriptor :: PluginId -> PluginDescriptor IdeState-descriptor plId = (defaultPluginDescriptor plId)+descriptor plId = (defaultPluginDescriptor plId desc)   { pluginHandlers = mkFormattingHandlers provider   }+  where+    desc = "Provides formatting of Haskell files via floskell. Built with floskell-" <> VERSION_floskell  -- --------------------------------------------------------------------- @@ -36,10 +39,10 @@     let (range, selectedContents) = case typ of           FormatText    -> (fullRange contents, contents)           FormatRange r -> (normalize r, extractTextInRange (extendToFullLines r) contents)-        result = reformat config (Just file) . TL.encodeUtf8 $ TL.fromStrict selectedContents+        result = reformat config (Just file) $ TL.fromStrict selectedContents     case result of       Left  err -> throwError $ PluginInternalError $ T.pack $ "floskellCmd: " ++ err-      Right new -> pure $ InL [TextEdit range . TL.toStrict $ TL.decodeUtf8 new]+      Right new -> pure $ InL [TextEdit range $ TL.toStrict new]  -- | Find Floskell Config, user and system wide or provides a default style. -- Every directory of the filepath will be searched to find a user configuration.