- Supported ghc-8.10, ghc-8.8
- The source file extension must be ".hs"
- Can not use STDIN handle while debugging.
- Creating tasks.json.
- Shortcut keys
- F5 : start / continue debugging
- F6 : show command menu
- Shift + F6 : stop watch
- F7 : clean & build
- F8 : start test
- F9 : put a breakpoint on the current line
- Shift + F9 : put a breakpoint on the current column
- F10 : step next
- F11 : step into
Install haskell-dap, ghci-dap, haskell-debug-adapter at once.
$ stack update
$
$ stack install haskell-dap ghci-dap haskell-debug-adapter
$
$ ghci-dap --version
[DAP][INFO] start ghci-dap-0.0.XX.0.
The Glorious Glasgow Haskell Compilation System, version 8.X.X
$
$ haskell-debug-adapter --version
VERSION: haskell-debug-adapter-0.0.XX.0
$
Install ghci-dap, haskell-debug-adapter.
$ cabal update
$
$ cabal install ghci-dap haskell-debug-adapter
$
$ haskell-debug-adapter --version
VERSION: haskell-debug-adapter-0.0.XX.0
$
$ mkdir project_stack
$ cd project_stack
$
$ stack new sample --bare
$ stack test
$
$ mkdir project_cabal
$ cd project_cabal
$
$ cabal init
$ cabal configure
$ cabal bulid
$
see sample files.
NAME | REQUIRED OR OPTIONAL | DEFAULT SETTING | DESCRIPTION |
---|---|---|---|
startup | required | ${workspaceRoot}/test/Spec.hs | debug startup file, will be loaded automatically. |
startupFunc | optional | "" (empty string) | debug startup function, will be run instead of main function. |
startupArgs | optional | "" (empty string) | arguments for startup function. set as string type. |
stopOnEntry | required | false | stop or not after debugger launched. |
mainArgs | optional | "" (empty string) | main arguments. |
ghciPrompt | required | H>>= | ghci command prompt string. |
ghciInitialPrompt | optional | "Prelude> " | initial pormpt of ghci. set it when using custom prompt. e.g. set in .ghci |
ghciCmd | required | stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show | launch ghci command, must be Prelude module loaded. For example, "cabal exec -- ghci-dap --interactive -i${workspaceFolder}/src" |
ghciEnv | required | [] | Environment variables for ghci exectution. |
logFile | required | ${workspaceRoot}/.vscode/phoityne.log | internal log file. |
logLevel | required | WARNING | internal log level. |
forceInspect | required | false | Inspect scope variables force. |