Skip to content

Commit a335fbf

Browse files
committed
Invert the dependency between hls-plugin-api and ghcide
1 parent 38151a0 commit a335fbf

File tree

13 files changed

+164
-920
lines changed

13 files changed

+164
-920
lines changed

hls-plugin-api/hls-plugin-api.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ source-repository head
2626
library
2727
exposed-modules:
2828
Ide.Logger
29-
Ide.Plugin
3029
Ide.Plugin.Config
31-
Ide.Plugin.Formatter
32-
Ide.Plugin.GhcIde
3330
Ide.PluginUtils
3431
Ide.Types
3532

@@ -40,9 +37,6 @@ library
4037
, containers
4138
, data-default
4239
, Diff
43-
, ghc
44-
, ghc-boot-th
45-
, ghcide >=0.5
4640
, haskell-lsp ^>=0.22
4741
, hashable
4842
, hslogger
@@ -53,6 +47,13 @@ library
5347
, text
5448
, unordered-containers
5549

50+
if os(windows)
51+
build-depends:
52+
Win32
53+
else
54+
build-depends:
55+
unix
56+
5657
ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing
5758

5859
if flag(pedantic)

hls-plugin-api/src/Ide/Logger.hs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,17 @@
33
-}
44
module Ide.Logger
55
(
6-
hlsLogger
7-
, logm
6+
logm
87
, debugm
98
, warningm
109
, errorm
1110
) where
1211

1312
import Control.Monad.IO.Class
14-
import qualified Data.Text as T
15-
import qualified Development.IDE.Types.Logger as L
1613
import System.Log.Logger
1714

1815
-- ---------------------------------------------------------------------
1916

20-
hlsLogger :: L.Logger
21-
hlsLogger = L.Logger $ \pri txt ->
22-
case pri of
23-
L.Telemetry -> logm (T.unpack txt)
24-
L.Debug -> debugm (T.unpack txt)
25-
L.Info -> logm (T.unpack txt)
26-
L.Warning -> warningm (T.unpack txt)
27-
L.Error -> errorm (T.unpack txt)
28-
29-
-- ---------------------------------------------------------------------
30-
3117
logm :: MonadIO m => String -> m ()
3218
logm s = liftIO $ infoM "hls" s
3319

0 commit comments

Comments
 (0)