Skip to content

Restore compat. with prettyprinter 1.6 #2877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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