From f39e6c1e33669c61a7bc2f42ab27adfd89eeea40 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sat, 30 Apr 2022 21:52:05 +0100 Subject: [PATCH 1/2] restore compat. with prettyprinter 1.6 --- ghcide/ghcide.cabal | 4 ++-- ghcide/src/Development/IDE/Types/Logger.hs | 6 ++++++ stack-lts16.yaml | 1 - 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 64f59c3c79..93bd51a950 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -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 @@ -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, diff --git a/ghcide/src/Development/IDE/Types/Logger.hs b/ghcide/src/Development/IDE/Types/Logger.hs index c57dc0f52c..a858a5f520 100644 --- a/ghcide/src/Development/IDE/Types/Logger.hs +++ b/ghcide/src/Development/IDE/Types/Logger.hs @@ -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 @@ -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) diff --git a/stack-lts16.yaml b/stack-lts16.yaml index 58d81a652e..7c43657322 100644 --- a/stack-lts16.yaml +++ b/stack-lts16.yaml @@ -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 From 2beea8903e3e1756cfe1cc406b70bfcbaa984718 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 1 May 2022 01:09:46 +0100 Subject: [PATCH 2/2] Fix another one --- exe/Main.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/exe/Main.hs b/exe/Main.hs index 56e7a7a82d..6257b72a3c 100644 --- a/exe/Main.hs +++ b/exe/Main.hs @@ -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 @@ -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