File tree 1 file changed +15
-2
lines changed
plugins/hls-tactics-plugin/src/Wingman
1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
1
{-# LANGUAGE BangPatterns #-}
2
2
{-# LANGUAGE CPP #-}
3
3
{-# LANGUAGE TypeApplications #-}
4
-
4
+ {-# OPTIONS_GHC -Wno-redundant-constraints #-}
5
+ {-# OPTIONS_GHC -Wno-unused-imports #-}
5
6
module Wingman.Debug
6
7
( unsafeRender
7
8
, unsafeRender'
@@ -16,7 +17,7 @@ module Wingman.Debug
16
17
17
18
import Control.DeepSeq
18
19
import Control.Exception
19
- import Debug.Trace
20
+ import qualified Debug.Trace
20
21
import Development.IDE.GHC.Compat (PlainGhcException , Outputable (.. ), SDoc , showSDocUnsafe )
21
22
import System.IO.Unsafe (unsafePerformIO )
22
23
@@ -47,3 +48,15 @@ traceIdX str a = trace (mappend ("!!!" <> str <> ": ") $ show a) a
47
48
traceFX :: String -> (a -> String ) -> a -> a
48
49
traceFX str f a = trace (mappend (" !!!" <> str <> " : " ) $ f a) a
49
50
51
+ traceM :: Applicative f => String -> f ()
52
+ trace :: String -> a -> a
53
+ traceShowId :: Show a => a -> a
54
+ #ifdef DEBUG
55
+ traceM = Debug.Trace. traceM
56
+ trace = Debug.Trace. trace
57
+ traceShowId = Debug.Trace. traceShowId
58
+ #else
59
+ traceM _ = pure ()
60
+ trace _ = id
61
+ traceShowId = id
62
+ #endif
You can’t perform that action at this time.
0 commit comments