Skip to content

Commit 44528b0

Browse files
committed
debugging
1 parent e1617bb commit 44528b0

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/Ide/LocalBindings.hs

+1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ mostSpecificSpan span z
161161

162162
------------------------------------------------------------------------------
163163
-- | Convert an HsVar back into an HsUnboundVar if it isn't actually in scope.
164+
-- TODO(sandy): this will throw away the type >:(
164165
holify :: Bindings -> LHsExpr GhcTc -> LHsExpr GhcTc
165166
holify (Bindings _ local) v@(L span (HsVar _ (L _ var))) =
166167
case M.lookup span local of

src/Ide/Plugin/Tactic.hs

+3
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ import Ide.LocalBindings
3737
import qualified Language.Haskell.LSP.Types as J
3838
import Language.Haskell.LSP.Types
3939

40+
import Data.List (intercalate)
4041
import OccName
4142
import HsExpr
4243
import GHC
4344
import DynFlags
4445
import Type
46+
import System.IO
4547

4648

4749
descriptor :: PluginId -> PluginDescriptor
@@ -233,6 +235,7 @@ tacticCmd :: (OccName -> TacticsM ()) -> CommandFunction TacticParams
233235
tacticCmd tac _lf state (TacticParams uri range var_name)
234236
| Just nfp <- uriToNormalizedFilePath $ toNormalizedUri uri = do
235237
(pos, _, jdg) <- judgmentForHole state nfp range
238+
hPutStrLn stderr $ intercalate "; " $ fmap (\(occ, CType ty) -> occNameString occ <> " :: " <> render unsafeGlobalDynFlags ty) $ Map.toList $ jHypothesis jdg
236239
pure $
237240
case runTactic
238241
unsafeGlobalDynFlags

src/Ide/TacticMachinery.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,6 @@ buildDataCon hy dc apps = do
224224
(HsVar NoExt $ noLoc $ Unqual $ nameOccName $ dataConName dc)
225225
$ fmap unLoc sgs
226226

227-
render :: Outputable (LHsExpr pass) => DynFlags -> LHsExpr pass -> String
227+
render :: Outputable a => DynFlags -> a -> String
228228
render dflags = showSDoc dflags . ppr
229229

src/Ide/Tactics.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ auto = (intro >> auto)
122122

123123

124124
autoIfPossible :: TacticsM () -> TacticsM ()
125-
autoIfPossible t = t >> (solve auto <!> pure ())
125+
autoIfPossible t = (t >> solve auto) <!> t
126126

127127

128128
one :: TacticsM ()

0 commit comments

Comments
 (0)