Skip to content

Commit 7cb37ea

Browse files
committed
silence the tactics plugin
1 parent 578ec7e commit 7cb37ea

File tree

1 file changed

+15
-2
lines changed
  • plugins/hls-tactics-plugin/src/Wingman

1 file changed

+15
-2
lines changed

plugins/hls-tactics-plugin/src/Wingman/Debug.hs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{-# LANGUAGE BangPatterns #-}
22
{-# LANGUAGE CPP #-}
33
{-# LANGUAGE TypeApplications #-}
4-
4+
{-# OPTIONS_GHC -Wno-redundant-constraints #-}
5+
{-# OPTIONS_GHC -Wno-unused-imports #-}
56
module Wingman.Debug
67
( unsafeRender
78
, unsafeRender'
@@ -16,7 +17,7 @@ module Wingman.Debug
1617

1718
import Control.DeepSeq
1819
import Control.Exception
19-
import Debug.Trace
20+
import qualified Debug.Trace
2021
import Development.IDE.GHC.Compat (PlainGhcException, Outputable(..), SDoc, showSDocUnsafe)
2122
import System.IO.Unsafe (unsafePerformIO)
2223

@@ -47,3 +48,15 @@ traceIdX str a = trace (mappend ("!!!" <> str <> ": ") $ show a) a
4748
traceFX :: String -> (a -> String) -> a -> a
4849
traceFX str f a = trace (mappend ("!!!" <> str <> ": ") $ f a) a
4950

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

0 commit comments

Comments
 (0)