phoityne / phoityne-vscode

Portal to Haskell Debugging System
https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode
59 stars 3 forks source link

How to debug project that have some module dependency #51

Open devxsss opened 4 years ago

devxsss commented 4 years ago

I try to debug main.hs that depend on other module. when i tried to compile in terminal such as "ghci main.hs" , it produced below

GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help [1 of 6] Compiling Queue ( Queue.hs, interpreted ) [2 of 6] Compiling Logic ( Logic.hs, interpreted ) [3 of 6] Compiling Parser ( Parser.hs, interpreted ) [4 of 6] Compiling Resolve ( Resolve.hs, interpreted ) [5 of 6] Compiling GenProof ( GenProof.hs, interpreted ) [6 of 6] Compiling Main ( main.hs, interpreted ) Ok, modules loaded: GenProof, Logic, Main, Parser, Queue, Resolve. *Main> main --output--

i manage to debug in main.hs but when it change to other module , nothing show up on screen . is there way to fix this?

H>>= [WARNING][REQUEST] unsupported request command. {"command":"source","arguments":{"sourceReference":0,"source":{"name":null,"path":"./Parser.hs","sourceReference":null,"origine":null}},"type":"request","seq":38} :dap-scopes ... H>>= :dap-variables ...

phoityne commented 4 years ago

Could you let me know these versions?

(seems like using old versions.) Regards.

devxsss commented 4 years ago

Thankyou for the reply

The Glorious Glasgow Haskell Compilation System, version 8.8.3 haskell-dap : haskell-dap is deprecated. but it seem 0.0.14.0 ghci-dap : start ghci-dap-0.0.14.0. haskell debug adapter :haskell-debug-adapter-0.0.33.0 vscode : 1.44.2 OS:ubuntu phoityne-vscode --version : phoityne-vscode-0.0.28.0

I use stack and cabal

try to install haskell-debug adapter using cabal

Warning: The package list for 'hackage.haskell.org' is 92 days old. Run 'cabal update' to get the latest list of available packages. cabal: There is no package named 'haskell-debug-adapater'. You may need to run 'cabal update' to get the latest list of available packages.

i reinstalled haskell-dap, but it said deprecated.

phoityne commented 4 years ago

Could you remove "phoityne-vscode" and "haskell-dap" binary files ? (currently, vscode extension uses haskell-debug-adapter and ghci-dap. installation.)

And let me know launch.json file. Regards.

devxsss commented 4 years ago

Thankyou for the quick reply.

Where should i remove the binary files? in the vscode folder? this is the launch.json file

  "version": "0.2.0",
  "configurations": [
    {
      "type": "ghc",
      "request": "launch",
      "name": "haskell-debug-adapter",
      "internalConsoleOptions": "openOnSessionStart",
      "workspace": "${workspaceFolder}",
      "startup": "${workspaceFolder}/main.hs",
      "startupFunc": "",
      "startupArgs": "",
      "stopOnEntry": false,
      "mainArgs": "main",
      "ghciPrompt": "H>>= ",
      "ghciInitialPrompt": "Prelude>",
      "ghciCmd":"stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show --with-ghc=haskell-dap" ,
      "ghciEnv": {},
      "logFile": "${workspaceFolder}/.vscode/phoityne.log",
      "logLevel": "INFO",
      "forceInspect": false
    }
  ]
}
phoityne commented 4 years ago

Where should i remove the binary files? in the vscode folder?

It would be in the "$HOME/.local/bin". You could find the path by this command.

$ stack exec which haskell-dap