Skip to content

Commit

Permalink
WIP debug
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpj committed Aug 27, 2023
1 parent dacb793 commit 132db94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lsp-test/test/DummyServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

module DummyServer where

import Colog.Core qualified as L
import Control.Monad
import Control.Monad.Reader
import Data.Aeson hiding (Null, defaultOptions)
Expand All @@ -26,6 +27,7 @@ import UnliftIO.Concurrent

withDummyServer :: ((Handle, Handle) -> IO ()) -> IO ()
withDummyServer f = do
let logger = L.cmap show L.logStringStderr
(hinRead, hinWrite) <- createPipe
(houtRead, houtWrite) <- createPipe

Expand All @@ -47,7 +49,7 @@ withDummyServer f = do
}

bracket
(forkIO $ void $ runServerWithHandles mempty mempty hinRead houtWrite definition)
(forkIO $ void $ runServerWithHandles logger (L.hoistLogAction liftIO logger) hinRead houtWrite definition)
killThread
(const $ f (hinWrite, houtRead))

Expand Down

0 comments on commit 132db94

Please sign in to comment.