Skip to content

Commit

Permalink
Invert the dependency between hls-plugin-api and ghcide
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Dec 27, 2020
1 parent 38151a0 commit a335fbf
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 920 deletions.
13 changes: 7 additions & 6 deletions hls-plugin-api/hls-plugin-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ source-repository head
library
exposed-modules:
Ide.Logger
Ide.Plugin
Ide.Plugin.Config
Ide.Plugin.Formatter
Ide.Plugin.GhcIde
Ide.PluginUtils
Ide.Types

Expand All @@ -40,9 +37,6 @@ library
, containers
, data-default
, Diff
, ghc
, ghc-boot-th
, ghcide >=0.5
, haskell-lsp ^>=0.22
, hashable
, hslogger
Expand All @@ -53,6 +47,13 @@ library
, text
, unordered-containers

if os(windows)
build-depends:
Win32
else
build-depends:
unix

ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing

if flag(pedantic)
Expand Down
16 changes: 1 addition & 15 deletions hls-plugin-api/src/Ide/Logger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,17 @@
-}
module Ide.Logger
(
hlsLogger
, logm
logm
, debugm
, warningm
, errorm
) where

import Control.Monad.IO.Class
import qualified Data.Text as T
import qualified Development.IDE.Types.Logger as L
import System.Log.Logger

-- ---------------------------------------------------------------------

hlsLogger :: L.Logger
hlsLogger = L.Logger $ \pri txt ->
case pri of
L.Telemetry -> logm (T.unpack txt)
L.Debug -> debugm (T.unpack txt)
L.Info -> logm (T.unpack txt)
L.Warning -> warningm (T.unpack txt)
L.Error -> errorm (T.unpack txt)

-- ---------------------------------------------------------------------

logm :: MonadIO m => String -> m ()
logm s = liftIO $ infoM "hls" s

Expand Down
Loading

0 comments on commit a335fbf

Please sign in to comment.