phoityne / haskell-dap Goto Github PK
View Code? Open in Web Editor NEWHaskell implementation of DAP interface data.
Home Page: https://hackage.haskell.org/package/haskell-dap
License: BSD 3-Clause "New" or "Revised" License
Haskell implementation of DAP interface data.
Home Page: https://hackage.haskell.org/package/haskell-dap
License: BSD 3-Clause "New" or "Revised" License
I have the following example code to debug
module Main where
import qualified Data.Map as M
errorsPerLine = M.fromList
[ ("Chris", 472), ("Don", 100), ("Simon", -5) ]
main = do putStrLn "Who are you?"
name <- getLine
case M.lookup name errorsPerLine of
Nothing -> putStrLn "I don't know you"
Just n -> do putStr "Errors per line: "
print n
launch json settings
{
"type": "ghc",
"request": "launch",
"name": "haskell-debug-adapter",
"internalConsoleOptions": "openOnSessionStart",
"workspace": "${workspaceFolder}",
"startup": "/homeokil.hs",
"startupFunc": "main",
"startupArgs": "olp",
"stopOnEntry": true,
"mainArgs": "okl",
"ghciPrompt": "H>>= ",
"ghciInitialPrompt": "Prelude>",
"ghciCmd": "stack ghci --with-ghc=haskell-dap --test ",
"ghciEnv": {},
"logFile": "${workspaceFolder}/.vscode/phoityne.log",
"logLevel": "INFO",
"forceInspect": false
}
after I change startupArgs and mainargs to some string, the getline line in code stop but cannot get any arguments from the startupargs that i have set it in launch json, it keep waiting
is there something wrong?
H>>= :load /home/devina/Documents/yogu/okil.hs
[1 of 1] Compiling Main ( /home/devina/Documents/yogu/okil.hs, interpreted )
Ok, one module loaded.
H>>= :dap-context-modules ...
H>>= :dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/okil.hs> [("Main","/home/devina/Documents/yogu/okil.hs")])
:dap-set-breakpoints ...
No breakpoints found at that location.
Breakpoint 0 activated at /home/devina/Documents/yogu/okil.hs:2:16-29
Breakpoint 1 activated at /home/devina/Documents/yogu/okil.hs:(4,8)-(9,19)
Breakpoint 2 activated at /home/devina/Documents/yogu/okil.hs:5:3-40
Breakpoint 3 activated at /home/devina/Documents/yogu/okil.hs:6:3-23
H>>= :dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/yogu/yogu.hs> [("Main","/home/devina/Documents/yogu/okil.hs")])
:dap-continue ...
:9:6: error: Variable not in scope: olp
H>>=
start debugging failed. user error (ExecResult not found.) : Left "user error (ExecResult not found.)"
the startup args : olp result error ExecResult not found. how to fix this?
Trying to debug Haskell project on Ubuntu using vscode with installed extensions:
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.4.4
$ stack --version
Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
$ code --version
1.30.1
dea8705087adb1b5e5ae1d9123278e178656186a
x64
When I create a simple project from template by:
$ stack new my-project simple
Also --with-ghc=haskell-dap
switch added to ghciCmd
, when try to debug project I get this error:
new feature. vscode-1.22
looks like they should be
this is a bug.
after lts released.
binary builded with ghc8.4 does not work with ghc8.2
Hello,
I am trying to debug Haskell with Visual Studio Code.
I am using the following extensions:
But the "--with-ghc=haskell-dap" option causes the IDE to just hang. I made sure that phoityne-vscode and haskell-dap are configured properly.
Check configuration:
PS C:\gf-rgl> phoityne-vscode --version
phoityne-vscode-0.0.28.0
PS C:\gf-rgl> haskell-dap --version
[DAP][INFO] start haskell-dap-0.0.12.0.
The Glorious Glasgow Haskell Compilation System, version 8.6.4
So if I launch debugging in Visual Studio Code with ghciCmd set to the following in launch.json:
stack ghci --with-ghc=haskell-dap --test --no-load --no-build --main-is tests --ghci-options -fprint-evld-with-show
It spits out the output below and then just hangs. If I take the "--with-ghc=haskell-dap" option out, it runs without error. Can someone tell me briefly what these options do and why do we want these specific launch options to use in the Visual Studio Code IDE?
Thanks,
Steve
Output of "stack ghci --with-ghc=haskell-dap" ghciCmd in launch.json:
CWD: C:\workspace_courses\gf_steve3po\gf-rgl\tests
CMD: stack ghci --with-ghc=haskell-dap --test --no-load --no-build --main-is tests --ghci-options -fprint-evld-with-show
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: tests
[DAP][INFO] start haskell-dap-0.0.12.0.
GHCi, version 8.6.4: http://www.haskell.org/ghc/ :? for help
Prelude>:set prompt "H>>= "
H>>= :set prompt-cont "H>>= "
H>>= :load C:/workspace_courses/gf_steve3po/gf-rgl/tests/run.hs
[1 of 1] Compiling Main ( C:\workspace_courses\gf_steve3po\gf-rgl\tests\run.hs, interpreted )
Ok, one module loaded.
H>>= :module + *Main
H>>= :set -fno-break-on-exception
H>>= :set -fno-break-on-error
H>>=
Now, ghci launched and configuration done.
Press F5 to start debugging.
Or modify source code. it will be loaded to ghci automatically.
H>>=
on windows.
can not set breakpoint on the file which located in the network folder.
by "net use" command, we can set drive letter to the network path.
but ghci still use network path like "\192.168.0.1\work\haskell\project".
vscode uses drive letter path or both?
haskell-dap has to check, convert the drive letter path to network path.
stacktrace history size can be set by -fghci-hist-size flag.
but, maxsize 50 is too mutch.
if showing all of them on VSCode UI, delay occurs.
for the solution of this issue.
adding :dap-break command and permit file path as the 1st argument.
inside the ghci, loaded module summary is available and can resolve module name from file path.
I'm attempting to use haskell-dap (0.0.13.0), phoityne-vscode (0.0.28.0) along with the phoityne-vscode extension with GHC 8.6.5 to debug code. When I run cabal new-repl --with-ghc=haskell-dap
, I get an error like
Warning: cannot determine version of
/nix/store/i9wdlh5hxk93r0c7hhhjw1axrhydk81j-ghc-8.6.5-with-packages/bin/ghci-dap
:
"[DAP][INFO] start ghci-dap-0.0.12.0.\n8.6.5\n"
cabal: The program 'ghc' version >=7.0.1 is required but the version of
/nix/store/i9wdlh5hxk93r0c7hhhjw1axrhydk81j-ghc-8.6.5-with-packages/bin/ghci-dap
could not be determined.
Is there any special set up needed to use this program with cabal new-* style commands? Is it compatible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.