NB! This is the best I could get in 2 hours. If you know any way to improve on this, please, share!
- Install latest Haskell Platform from prior versions page. Newer versions of Haskell Platform are installable only through Chocolatey and elevated command prompt, and in the end it won't work, because GHC 9 is too new and not supported by VSCode plugins.
- Restart VSCode, if it was running. On Windows global environment variables get fixed at program startup, and extensions won't find GHC.
- Install syntax highlighting extension.
- Install language service client extension. The first time
*.hsfile is opened, it will download required language server binaries.
- Open Msys command prompt (available as Git Bash from context menu in any folder, if Git is installed).
cabal updateto download latest package version version information.
cabal install ghci-dap haskell-debug-adapter.
- Install Haskell debugger extension.
Project setup (mostly from Haskell debugger extension
- Create a folder.
cabal configure, and
cabal bulidin it (this time regular command prompt is enough).
- Switch to
Run and Debugtab in VSCode and press
Create a launch.json filelink. Select
- In toolbar select
- Put a breakpoint and press F5 to run.