Skip to content

Commit 1e5940b

Browse files
authored
Remove deprecated prettyprinter usage (#565)
* Remove deprecated prettyprinter usage We've been requiring the latest major version for a while anyway. * Fix formatting
1 parent e25304f commit 1e5940b

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

lsp/example/Reactor.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
{-# LANGUAGE LambdaCase #-}
55
{-# LANGUAGE OverloadedStrings #-}
66
{-# LANGUAGE TypeInType #-}
7-
-- So we can keep using the old prettyprinter modules (which have a better
8-
-- compatibility range) for now.
9-
{-# OPTIONS_GHC -Wno-deprecations #-}
107

118
{- |
129
This is an example language server built with haskell-lsp using a 'Reactor'
@@ -36,7 +33,6 @@ import Control.Monad.STM
3633
import Data.Aeson qualified as J
3734
import Data.Int (Int32)
3835
import Data.Text qualified as T
39-
import Data.Text.Prettyprint.Doc
4036
import GHC.Generics (Generic)
4137
import Language.LSP.Diagnostics
4238
import Language.LSP.Logging (defaultClientLogger)
@@ -45,6 +41,7 @@ import Language.LSP.Protocol.Message qualified as LSP
4541
import Language.LSP.Protocol.Types qualified as LSP
4642
import Language.LSP.Server
4743
import Language.LSP.VFS
44+
import Prettyprinter
4845
import System.Exit
4946
import System.IO
5047

lsp/src/Language/LSP/Server/Control.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
{-# LANGUAGE LambdaCase #-}
22
{-# LANGUAGE OverloadedStrings #-}
3-
-- So we can keep using the old prettyprinter modules (which have a better
4-
-- compatibility range) for now.
5-
{-# OPTIONS_GHC -Wno-deprecations #-}
63

74
module Language.LSP.Server.Control (
85
-- * Running
@@ -30,12 +27,12 @@ import Data.List
3027
import Data.Text qualified as T
3128
import Data.Text.Lazy qualified as TL
3229
import Data.Text.Lazy.Encoding qualified as TL
33-
import Data.Text.Prettyprint.Doc
3430
import Language.LSP.Logging (defaultClientLogger)
3531
import Language.LSP.Protocol.Message
3632
import Language.LSP.Server.Core
3733
import Language.LSP.Server.Processing qualified as Processing
3834
import Language.LSP.VFS
35+
import Prettyprinter
3936
import System.IO
4037

4138
data LspServerLog

lsp/src/Language/LSP/Server/Processing.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
{-# LANGUAGE RecordWildCards #-}
55
{-# LANGUAGE RecursiveDo #-}
66
{-# LANGUAGE TypeInType #-}
7-
-- So we can keep using the old prettyprinter modules (which have a better
8-
-- compatibility range) for now.
9-
{-# OPTIONS_GHC -Wno-deprecations #-}
107
-- there's just so much!
118
{-# OPTIONS_GHC -Wno-name-shadowing #-}
129
{-# OPTIONS_GHC -Wno-unticked-promoted-constructors #-}
@@ -54,14 +51,14 @@ import Data.Monoid
5451
import Data.String (fromString)
5552
import Data.Text qualified as T
5653
import Data.Text.Lazy.Encoding qualified as TL
57-
import Data.Text.Prettyprint.Doc
5854
import Language.LSP.Protocol.Lens qualified as L
5955
import Language.LSP.Protocol.Message
6056
import Language.LSP.Protocol.Types
6157
import Language.LSP.Protocol.Utils.SMethodMap (SMethodMap)
6258
import Language.LSP.Protocol.Utils.SMethodMap qualified as SMethodMap
6359
import Language.LSP.Server.Core
6460
import Language.LSP.VFS as VFS
61+
import Prettyprinter
6562
import System.Exit
6663

6764
data LspProcessingLog

lsp/src/Language/LSP/VFS.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
{-# LANGUAGE TemplateHaskell #-}
77
{-# LANGUAGE TypeInType #-}
88
{-# LANGUAGE ViewPatterns #-}
9-
-- So we can keep using the old prettyprinter modules (which have a better
10-
-- compatibility range) for now.
11-
{-# OPTIONS_GHC -Wno-deprecations #-}
129

1310
{- |
1411
Handles the "Language.LSP.Types.TextDocumentDidChange" \/
@@ -70,13 +67,13 @@ import Data.Ord
7067
import Data.Text (Text)
7168
import Data.Text qualified as T
7269
import Data.Text.IO qualified as T
73-
import Data.Text.Prettyprint.Doc hiding (line)
7470
import Data.Text.Utf16.Lines as Utf16 (Position (..))
7571
import Data.Text.Utf16.Rope.Mixed (Rope)
7672
import Data.Text.Utf16.Rope.Mixed qualified as Rope
7773
import Language.LSP.Protocol.Lens qualified as J
7874
import Language.LSP.Protocol.Message qualified as J
7975
import Language.LSP.Protocol.Types qualified as J
76+
import Prettyprinter hiding (line)
8077
import System.Directory
8178
import System.FilePath
8279
import System.IO

0 commit comments

Comments
 (0)