Skip to content

Commit

Permalink
Restore compat. with prettyprinter 1.6 (haskell#2877)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra authored and sloorush committed May 21, 2022
1 parent b33d9da commit a3603ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions exe/Main.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
{-# LANGUAGE CPP #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module Main(main) where
Expand All @@ -23,7 +24,11 @@ import Ide.Types (PluginDescriptor (pluginNotificat
import Language.LSP.Server as LSP
import Language.LSP.Types as LSP
import qualified Plugins
#if MIN_VERSION_prettyprinter(1,7,0)
import Prettyprinter (Pretty (pretty), vsep)
#else
import Data.Text.Prettyprint.Doc (Pretty (pretty), vsep)
#endif

data Log
= LogIdeMain IdeMain.Log
Expand Down
4 changes: 2 additions & 2 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cabal-version: 2.4
build-type: Simple
category: Development
name: ghcide
version: 1.7.0.0
version: 1.7.0.1
license: Apache-2.0
license-file: LICENSE
author: Digital Asset and Ghcide contributors
Expand Down Expand Up @@ -72,7 +72,7 @@ library
optparse-applicative,
parallel,
prettyprinter-ansi-terminal,
prettyprinter >= 1.7,
prettyprinter >= 1.6,
random,
regex-tdfa >= 1.3.1.0,
retrie,
Expand Down
6 changes: 6 additions & 0 deletions ghcide/src/Development/IDE/Types/Logger.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0

{-# LANGUAGE CPP #-}
{-# LANGUAGE RankNTypes #-}
-- | This is a compatibility module that abstracts over the
-- concrete choice of logging framework so users can plug in whatever
Expand Down Expand Up @@ -54,8 +55,13 @@ import Language.LSP.Types (LogMessageParams (..),
MessageType (..),
SMethod (SWindowLogMessage, SWindowShowMessage),
ShowMessageParams (..))
#if MIN_VERSION_prettyprinter(1,7,0)
import Prettyprinter as PrettyPrinterModule
import Prettyprinter.Render.Text (renderStrict)
#else
import Data.Text.Prettyprint.Doc as PrettyPrinterModule
import Data.Text.Prettyprint.Doc.Render.Text (renderStrict)
#endif
import System.IO (Handle, IOMode (AppendMode),
hClose, hFlush, hSetEncoding,
openFile, stderr, utf8)
Expand Down
1 change: 0 additions & 1 deletion stack-lts16.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ extra-deps:
- monad-dijkstra-0.1.1.2
- opentelemetry-0.6.1
- opentelemetry-extra-0.6.1
- prettyprinter-1.7.1
- refinery-0.4.0.0
- retrie-1.1.0.0
- semigroups-0.18.5
Expand Down

0 comments on commit a3603ec

Please sign in to comment.