Skip to content

Commit

Permalink
update Floskell to 0.11.*
Browse files Browse the repository at this point in the history
Floskell 0.11.* supports Aeson 2.2.*
  • Loading branch information
peterbecich committed Jan 6, 2024
1 parent 93b6bf5 commit 5e3b761
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0
category: Development
name: haskell-language-server
version: 2.5.0.0
version: 2.5.0.1
synopsis: LSP server for GHC
description:
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
Expand Down Expand Up @@ -310,7 +310,7 @@ common overloadedRecordDot

common floskell
if flag(floskell) && (impl(ghc < 9.7) || flag(ignore-plugins-ghc-bounds))
build-depends: hls-floskell-plugin == 2.5.0.0
build-depends: hls-floskell-plugin == 2.5.*
cpp-options: -Dhls_floskell

common fourmolu
Expand Down
4 changes: 4 additions & 0 deletions plugins/hls-floskell-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Revision history for hls-floskell-plugin

## 2.5.1.0 -- 2024-01-05
Updates Floskell dependency to 0.11.*, which supports Aeson 2.2.*
4 changes: 2 additions & 2 deletions plugins/hls-floskell-plugin/hls-floskell-plugin.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: hls-floskell-plugin
version: 2.5.0.0
version: 2.5.1.0
synopsis: Integration with the Floskell code formatter
description:
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
Expand Down Expand Up @@ -28,7 +28,7 @@ library
hs-source-dirs: src
build-depends:
, base >=4.12 && <5
, floskell ^>=0.10.8
, floskell ^>=0.11.0
, ghcide == 2.5.0.0
, hls-plugin-api == 2.5.0.0
, lsp-types ^>=2.1
Expand Down
4 changes: 2 additions & 2 deletions plugins/hls-floskell-plugin/src/Ide/Plugin/Floskell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ provider _ideState typ contents fp _ = do
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.
Expand Down

0 comments on commit 5e3b761

Please sign in to comment.