Code Monkey home page Code Monkey logo

haskell-dap's Introduction

What can we do with Haskell and Azure ?

az-305 az-400

haskell-dap's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

haskell-dap's Issues

phoityne vscode input

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?

ghci launch error

Trying to debug Haskell project on Ubuntu using vscode with installed extensions:

  • Haskell Language Server
  • Haskell Syntax Highlighting
  • Haskell GHCi Debug Adapter Phoityne
$ 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:
err

Using "--with-ghc=haskell-dap" in Visual Studio Code

Hello,
I am trying to debug Haskell with Visual Studio Code.

I am using the following extensions:

  • Grammatical Framework
  • Haskell GHCi Debug Adapter Phoityne
  • Haskell Language Server
  • Haskell Syntax Highlight
  • haskell-linter
  • Haskelly

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>>= 

paging stacktrace.

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.

resolve module name from file path.

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.

Launching with cabal new-repl doesn't work

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.