Skip to content
Browse files

Add debug command for printing the module graph.

  • Loading branch information...
1 parent 0a171ed commit d1f30073060dcdd8848d2366c010aa004887f1ff @nominolo committed Aug 29, 2009
Showing with 15 additions and 1 deletion.
  1. +4 −0 emacs/scion.el
  2. +11 −1 server/Scion/Server/Commands.hs
View
4 emacs/scion.el
@@ -2282,6 +2282,10 @@ forces it to be off. NIL toggles the current state."
(interactive)
(scion-eval '(dump-defined-names)))
+(defun scion-dump-module-graph ()
+ (interactive)
+ (scion-eval '(dump-module-graph)))
+
(define-key scion-mode-map "\C-c\C-t" 'scion-thing-at-point)
(provide 'scion)
View
12 server/Scion/Server/Commands.hs
@@ -36,7 +36,7 @@ import FastString
import GHC
import PprTyThing ( pprTypeForUser )
import Outputable ( ppr, showSDoc, showSDocDump, dcolon, showSDocForUser,
- showSDocDebug )
+ showSDocDebug, printDump )
import qualified Outputable as O ( (<+>), ($$) )
import Control.Applicative
@@ -173,6 +173,7 @@ allCommands =
, cmdDefinedNames
, cmdNameDefinitions
, cmdIdentify
+ , cmdDumpModuleGraph
]
------------------------------------------------------------------------------
@@ -586,3 +587,12 @@ cmdIdentify :: Cmd
cmdIdentify =
Cmd "client-identify" $ reqArg' "name" fromJSString $ cmd
where cmd c = modifySessionState $ \s -> s { client = c }
+
+cmdDumpModuleGraph :: Cmd
+cmdDumpModuleGraph =
+ Cmd "dump-module-graph" $ noArgs $ cmd
+ where
+ cmd = do
+ mg <- getModuleGraph
+ liftIO $ printDump (ppr mg)
+ return ()

0 comments on commit d1f3007

Please sign in to comment.
Something went wrong with that request. Please try again.