A Zed extension that enables debugging Haskell applications using haskell-debug-adapter.
Install haskell-debug-adapter and ensure it's in your $PATH:
cabal install haskell-dap ghci-dap haskell-debug-adapter-
Open Zed editor
-
Install the dev extension:
- Press
Cmd+Shift+P(macOS) orCtrl+Shift+P(Linux/Windows) - Type and select:
zed: install dev extension - Choose this extension folder
- Press
-
Configure debug settings:
- Create
.zed/debug.jsonin your project root - Copy the example configuration from
example/debug.json
- Create
Create .zed/debug.json with:
[
{
"adapter": "Haskell",
"label": "Haskell debugger",
"name": "Haskell debugger",
"type": "ghc",
"request": "launch",
"cwd": "$ZED_WORKTREE_ROOT",
"startup": "$ZED_WORKTREE_ROOT/app/Main.hs",
"workspace": "$ZED_WORKTREE_ROOT",
"logFile": "$ZED_WORKTREE_ROOT/.zed/haskell-debug.log",
"ghciCmd": "cabal repl <your-binary-name> -w ghci-dap --repl-no-load",
"logLevel": "INFO",
"startupFunc": "main",
"startupArgs": "",
"stopOnEntry": true,
"mainArgs": "",
"ghciPrompt": "H>>= ",
"ghciInitialPrompt": "> ",
"ghciEnv": {},
"forceInspect": false
}
]Important: Replace <your-binary-name> in ghciCmd with your actual executable name from your .cabal file.
- Open your Haskell project in Zed
- Set breakpoints in your code
- Press
F5or rundebug: startfrom command palette - Select "Haskell debugger"
Voilà, let's debug!
If debugging doesn't start:
- Verify
haskell-debug-adapteris in your PATH:which haskell-debug-adapter - Check the log file at
.zed/haskell-debug.log - View Zed logs:
Cmd+Shift+P→zed: open log