This is an experimental.
- Windows10
- vim-8.2
- python36
- vimspector
- Download
https://ftp.nluug.nl/pub/vim/pc/- gvim82.exe
- Install
prefix: c:\prefix\vim82
- Download
https://www.python.org/downloads/release/python-368/- Windows x86 embeddable zip file
- Install
prefix: c:\prefix\python-3.6.8-embed-win32
- Download
https://github.com/puremourning/vimspector/releases/- Source code (zip)
- Install
prefix: C:\prefix\vim82\pack\package\opt\vimspector
@see https://github.com/phoityne/hdx4vsc
> cd haskell/project
> vi .vimspector.json
{
"adapters": {
"hda": {
"name": "haskell-debug-adapter",
"command": [
"haskell-debug-adapter",
"--hackage-version=0.0.31.0"
]
}
},
"configurations": {
"haskell-debug-adapter: Launch": {
"adapter": "hda",
"configuration": {
"type": "ghc",
"request": "launch",
"name": "haskell-debug-adapter",
"internalConsoleOptions": "openOnSessionStart",
"workspace": "${workspaceRoot}",
"startup": "${workspaceRoot}/test/Spec.hs",
"startupFunc": "",
"startupArgs": "",
"stopOnEntry": true,
"mainArgs": "",
"ghciPrompt": "H>>= ",
"ghciInitialPrompt": "> ",
"ghciCmd": "stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show",
"ghciEnv": {},
"logFile": "${workspaceRoot}/hdx4vim.log",
"logLevel": "WARNING",
"forceInspect": false
}
}
}
}
>
> cd c:/haskell/project/path
> vi vimrc
set encoding=utf-8
set pythonthreedll=C:\prefix\python-3.6.8-embed-win32\python36.dll
packadd vimspector
>
> cd c:/haskell/project/path
> set VIM=c:/haskell/project/path
>
> gvim test/UtilSpec.hs
:call vimspector#ToggleBreakpoint()
:call vimspector#Launch()
- Windows10
- neovim-5.0-dev
- python3
- vimspector
https://github.com/neovim/neovim/releases/
set XDG_CONFIG_HOME=C:\prefix\neovim\conf
https://www.python.org/downloads/windows/
> pip3 install neovim
:checkhealth
## Python 3 provider (optional)
- INFO: `g:python3_host_prog` is not set. Searching for python3 in the environment.
- INFO: Multiple python3 executables found. Set `g:python3_host_prog` to avoid surprises.
- INFO: Executable: /bin/python3
- INFO: Other python executable: /usr/bin/python3
- INFO: Python version: 3.6.8
- INFO: pynvim version: 0.4.0
- OK: Latest pynvim is installed.
> cd %XDG_CONFIG_HOME%\nvim\pack\dap\start
>
> git clone https://github.com/puremourning/vimspector.git
>
> vi %XDG_CONFIG_HOME%\nvim\init.vim
let g:vimspector_enable_mappings = 'VISUAL_STUDIO'
packadd vimspector
>
@see https://github.com/phoityne/hdx4vsc
Create .vimspector.json in the stack project folder.
see sample files.
> nvim-qt test/UtilSpec.hs
:call vimspector#ToggleBreakpoint() -> F9
:call vimspector#Launch() -> F5
:call vimspector#vimspector#StepOver() -> F10
:VimspectorReset -> exit
@see https://github.com/puremourning/vimspector#visual-studio--vscode
- Windows10
- neovim-5.0-dev
- nvim-dap
https://github.com/neovim/neovim/releases/
set XDG_CONFIG_HOME=C:\prefix\neovim\conf
> cd %XDG_CONFIG_HOME%\nvim\pack\dap\start
>
> git clone https://github.com/mfussenegger/nvim-dap.git
>
> vi %XDG_CONFIG_HOME%\nvim\init.vim
packadd nvim-dap
set langmenu=en_US.UTF-8
language messages en_US.UTF-8
lua << EOF
local dap = require('dap')
dap.adapters.haskell = {
type = 'executable';
command = 'haskell-debug-adapter.exe';
args = { '--hackage-version', '0.0.31' };
}
local workspaceFolder = vim.fn.getcwd()
dap.configurations.haskell = {
{
type = 'haskell';
request = 'launch';
name = "haskell-debug-adapter";
program = "${file}";
workspace = "${workspaceFolder}";
startup = "${workspaceFolder}/test/Spec.hs";
startupFunc = "";
startupArgs = "";
stopOnEntry = false;
mainArgs = "";
ghciPrompt = "H>>= ";
ghciInitialPrompt = "> ";
ghciCmd = "stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show";
ghciEnv = {dummy=""},
logFile = "${workspaceFolder}/hda.log";
logLevel = "DEBUG";
forceInspect = false;
}
}
EOF
nnoremap <silent> <F5> :lua require'dap'.continue()<CR>
nnoremap <silent> <F9> :lua require'dap'.toggle_breakpoint()<CR>
nnoremap <silent> <F10> :lua require'dap'.step_over()<CR>
nnoremap <silent> <F11> :lua require'dap'.step_into()<CR>
>
@see https://github.com/phoityne/hdx4vsc
> nvim-qt app\Main.hs