phoityne / phoityne-vscode Goto Github PK
View Code? Open in Web Editor NEWPortal to Haskell Debugging System
Home Page: https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode
Portal to Haskell Debugging System
Home Page: https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode
I can debug Main file but cannot debug big project that have some file in it , how can it compile some haskell file when debugging?
What is the json settings?
I got some Error like
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/Geometry/Cuboid.hs> [("Main","/home/devina/Documents/docck/Geometry/hs.hs")])
when i put file in folder name geometry , how to fix this?
Hello,
I saw you fixed the issue with spaces in filenames in startup option which is awesome, thank you. Unfortunately this exact issue is still present on auto reload after saving. For example:
Filepath: C:\Users\here is space\main.hs
This is now correctly loaded on startup even when you use environment variables(like ${file}) in launch.json. But if I save the file and auto reload kicks in, I get an error:
Couldn't read "\"C:\\Users\\here is space\\main.hs\"" as String
Keep up the awesome work!
Just installed VS Code with this extension (along with Haskell Syntax Linter, haskell-linter and Haskell ghc-mod) under macOS High Sierra and I can't get it to work at all. When I select "Start debugging (F5)" and then ghci debug viewer Phoityne it just dies with the debug console showing the following message:
[CRITICAL]<launch> request parce error.
Content-Length: 144
{"command":"launch","arguments":{"type":"ghc","request":"launch","__sessionId":"16e869ec-1e82-4b09-a59e-ad41be2c022c"},"type":"request","seq":2}
"Error in $.arguments: When parsing the record LaunchRequestArguments of type Phoityne.VSCode.TH.LaunchRequestArgumentsJSON.LaunchRequestArguments the key name was not present."
`stack update` and install new phoityen-vscode.
Or check information on https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode
[disconnectRequestHandler] ghci not started.
Tried the suggested "stack update" but no luck. Any ideas?
There already has been add ghciEnv setting on launch.json.
But it is not uesed in phoityne-vscode yet.
After first creating a stack project, launch.json
, phoityne.log
, and tasks.json
are not automatically generated after hitting f5 to start debugging. These files must be generated by going into the debugger menu and clicking the 'create a launch.json file' and selecting haskell-debug-adapter.
Windows 10
VSCode 1.42.1
Stack 2.1.3
ghc 8.6.5
Steps to reproduce:
stack new my-project
lts-14.20
in stack.yaml
stack setup
app/Main.hs
Observations:
Nothing happens. Files are not created in .vscode
directory.
I don't know how to configure launch.json.
After I ran stack install phoityne-vscode, what should I do?
Can you give me some tips?
Running vs code 1.31.1.
I eventually stumbled on needing to run stack install haskell-dap, and adding a --with-ghc=haskell-dap argument for my ghci launch config in VS code. If this is required, shouldn't it be installed as a dependency and configured to launch?
Or if not, what was I missing in order to debug without it?
Error log:
CWD: /home/neo/Projects/haskell-stack-fix
CMD: stack ghci --with-ghc=haskell-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show
Writing implicit global project config file to: /home/neo/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-14.1
openAnonymousTempFileFromDir: inappropriate type (Is a directory)
------------------------------------
can not parse ghci version. ["getGHCiVersion" (line 5, column 1):
unexpected end of input
expecting "GHCi, version "] assumes 8.0.0.
------------------------------------
:set prompt "H>>= "
Related: commercialhaskell/stack#5010
user$ stack install phoityne-vscode haskell-dap
[...]
user$ haskell-dap
yields:
dyld: Library not loaded: @rpath/libHShaskell-dap-0.0.10.0-8CeORxiLfA5733gsM81yXO-ghc8.2.2.dylib
Referenced from: /Users/user/.local/bin/haskell-dap
Reason: image not found
Abort trap: 6
Any way to correctly point to the dyld?
supportting Column break points #14784
ghci supports column option with :break command.
:break [<mod>] <l> [<col>] set a breakpoint at the specified location
Consider updating the ioLoop
to check for eof when reading, and then exit.
Otherwise the process hangs around if it is not shut down cleanly.
See https://github.com/alanz/haskell-lsp/blob/master/src/Language/Haskell/LSP/Control.hs#L58
[OS] Windows7, 10
[VSCode Version] phoityne-vscode-0.8.0
[Hackage Version] phoityne-vscode-0.0.10.0
[Symptom]
Debug can be started, but can not continue. (by press F5 or click icon.)
[Status]
investigating...
(2016/11/07)
not yet figure out reason why.
There is no output in phoityne debug log file.
It seems like that no request send from vscode.
On vscode insiders(ver1.8.0), it does not work.
On vscode debug enviroment(github master. ver1.8.0), it works.
so that, can not debug from javascript side.
might be setting file problem.(launch.json, package.json, tasks.json)
There already has been add stopOnEntry setting on launch.json.
But it is not uesed in phoityne-vscode.
Currently acts pause after starting debug. (stopOnEntry == True)
Just started using phoityne in VS Code and I just wonder why the default setup is not the application file but the test file. A friend of mine is just starting using Haskell and got stuck on this for some hour and it is not obvious in VS Code how to change to run the application instead of the tests.
Of course I am happy that someone makes a debugger extension for Haskell for VS Code, I just think that starting using it could be easier.
Debugging command line is like:
stack ghci project:project-gui --stack-yaml stack-windows.yaml --no-load --no-build --main-is main --ghci-options -fprint-evld-with-show
When I press F5 and it tries to run this command line but hangs. If I start this from command-line on Windows - everything is fine. I think may be it hangs on output parsing.
This is what command-line execution gives. Have in mind that there is a prompt and type information is working, no matter that you see an error. This error is not visible in VS Code, too.
The following GHC options are incompatible with GHCi and have not been passed to it: -Werror -threaded -O2
Configuring GHCi with the following packages: vraybench
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
ghc.EXE: addLibrarySearchPath: C:\Users\home\AppData\Local\Temp\stack372536\wxc-0.92.2.0 (Win32 error 3): The system cannot find the path specified.
Loaded GHCi configuration from C:\Users\home\AppData\Roaming\ghc\ghci.conf
>
I have installed both the cabal and stack version of the packages and made sure that the stack module is in the path and yet the extension is not working. When I try to debug the environment with the name 'ghci debug view phoityne' shows up but then nothing happens when I select it. I am using module version 0.0.12.0. Visual studio code version is 1.10.1. Do let me know if I need to supply some more info. I tried looking for log etc. but could not find any.
Any advice is highly appreciated.
Have you or can you release the source for the plugin and the repository for the haskell backend? This will probably make an ideal starting point for adding Intero support to VSCode. I would like to help with that if possible.
Start debugging my application debugger gives me two problems:
stack ghci --test --no-load --no-build --main-is TARGET in d:\ProcessJIRA
Configuring GHCi with the following packages: ProcessJIRA
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from C:\Users\home\AppData\Roaming\ghc\ghci.conf
Prelude> :set prompt "H>>= "
H>>= :set prompt2 "H>>= "
H>>= :load d:\ProcessJIRA/test/Spec.hs
<no location info>: error:
can't find file: d:\ProcessJIRA/test/Spec.hs
Failed, modules loaded: none.
H>>=
load file fail.[d:\ProcessJIRA/test/Spec.hs] file load error. 'd:\ProcessJIRA/test/Spec.hs'startup load error. d:\ProcessJIRA/test/Spec.hs
:break Main 12
<no location info>: error:
Could not find module `Main'
It is not a module in the current program, or in any known package.
H>>=
I am trying to load GHC into phoityne.
Loading GHC into GHCI doesn't take very long, < 1 minute.
Using the same command with phoityne
leads to a period of about 5 minutes where phoityne
uses a lot of CPU resources and no output is displayed to the terminal. After this the output of running the command to load GHC into GHCi is displayed.
What is phoityne
doing in those initial 5 minutes before it starts to load ghci?
If you have file named GUIMain.hs containing module Main you cannot put a break point in it.
It works only if file name and module name match.
":break" command needs a module name, not a file name. So all files should be enumerated for modules to make a mapping between file name and module name.
When I click the "Start Debugging" button, the progress bar starts moving, and stack ghci --test --no-load --no-build --main-is TARGET in /Users/marnold/Code/lambda/cloud-seeder
shows up in the "DEBUG CONSOLE" window, and then...nothing else happens. The "Continue" button remains grayed out. Eventually I hit the "Stop" button twice, causing the progress bar to stop and the debug control buttons to disappear.
As far as I can tell, I've followed the installation instructions to the letter. phoityne-vscode
is present in my path.
I can't start the Haskell debugger.
After having installed the debug adapter and created a dummy project, I've set a break point and started the debugger (F5). A debugger floating toolbox briefly appeared, vanished, then..., nothing. And no debugger log file (phoityne.log) got created under the .vscode sub-directory.
CONTEXT:
DETAILS:
I have created a project with the following command
iMac:~ usr$ stack new my-project
iMac:~ usr$ cd my-project
iMac:my-project usr$ stack setup
iMac:my-project usr$ stack build
I have installed the dependencies of the Debug Adapter with the following command.
iMac:my-project usr$ stack build --copy-compiler-tool phoityne-vscode haskell-dap
The binaries got installed under ~/.stack/compiler-tools/x86_64-osx/ghc-8.6.4/bin
.
I have included that directory in the PATH environment variable. I always launch vscode through the UNIX terminal under the my-project
directory so that the IDE has access to this PATH environment variable.
Here are the versions of the dependencies I have installed:
iMac:my-project usr$ phoityne-vscode --version
phoityne-vscode-0.0.28.0
iMac:my-project usr$ haskell-dap --version
haskell-dap-0.0.12.0
iMac:my-project usr$ hlint --version
HLint v2.1.11, (C) Neil Mitchell 2006-2018
Here is the content of the launch.json used for the Debug Adapter:
Please note that I'm using --with-ghc=haskell-dap
for the ghciCmd variable. But if I try this command in a terminal window within my project directory...
iMac:my-project usr$ stack ghci --test --no-load --no-build --with-ghc=haskell-dap --main-is TARGET --ghci-options -fprint-evld-with-show
I get the following:
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
Configuring GHCi with the following packages: my-project
[DAP][INFO] start haskell-dap-0.0.12.0.
GHCi, version 8.6.4: http://www.haskell.org/ghc/ :? for help
haskell-dap:
lookupSymbol failed in relocateSection (relocate external)
/Users/utilisationnormale/.stack/programs/x86_64-osx/ghc-8.6.4/lib/ghc-8.6.4/unix-2.7.2.2/HSunix-2.7.2.2.o: unknown symbol '_utimensat'
haskell-dap: unable to load package 'unix-2.7.2.2'
But if, in the terminal window, I try the same command without the --with-ghc=haskell-dap
then it works. I tried to remove that from the launch.json but the debugger does't start in vscode.
As a final note, I've also tried the debugger after having replaced ${workspaceFolder} with the path of the project within the launch.json file. Alas, I got the same result.
Thanks in advance,
The first messages I get are
Fetched package index.
Populated index cache.
Did not find .cabal file for vector-0.11.0.0 with Git SHA of b5f3b76add6538e0596f3ef48f90dac27eb8b903
Right Nothing
Did not find .cabal file for operational-0.2.3.4 with Git SHA of a3e1c094f2c38590cfee932c1ca6b7f6a59efa1e
Right Nothing
Did not find .cabal file for jwt-0.7.2 with Git SHA of 90696469dc6b70663a988529b5826e05fa899801
Right Nothing
But it continues processing and I get
Configuring network-2.6.3.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-pc-mingw64
checking host system type... x86_64-pc-mingw64
checking for gcc... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe accepts -g... yes
checking for C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... C:\PROGRA~1\HASKEL~1\802E01~1.1\mingw\bin\gcc.exe -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking winsock2.h usability... yes
checking winsock2.h presence... yes
checking for winsock2.h... yes
checking ws2tcpip.h usability... yes
checking ws2tcpip.h presence... yes
checking for ws2tcpip.h... yes
checking arpa/inet.h usability... no
checking arpa/inet.h presence... no
checking for arpa/inet.h... no
checking netdb.h usability... no
checking netdb.h presence... no
checking for netdb.h... no
checking netinet/in.h usability... no
checking netinet/in.h presence... no
checking for netinet/in.h... no
checking netinet/tcp.h usability... no
checking netinet/tcp.h presence... no
checking for netinet/tcp.h... no
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking sys/uio.h usability... no
checking sys/uio.h presence... no
checking for sys/uio.h... no
checking sys/un.h usability... no
checking sys/un.h presence... no
checking for sys/un.h... no
checking linux/can.h usability... no
checking linux/can.h presence... no
checking for linux/can.h... no
checking linux/tcp.h usability... no
checking linux/tcp.h presence... no
checking for linux/tcp.h... no
checking net/if.h usability... no
checking net/if.h presence... no
checking for net/if.h... no
checking for readlink... no
checking for symlink... no
checking for if_nametoindex... no
checking for struct msghdr.msg_control... no
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for in_addr_t in netinet/in.h... no
checking for SO_PEERCRED and struct ucred in sys/socket.h... no
checking for getpeereid in unistd.h... checking for getpeereid... no
checking for _head_libws2_32_a in -lws2_32... no
checking for getaddrinfo... no
checking for gai_strerror... no
checking whether AI_ADDRCONFIG is declared... no
checking whether AI_ALL is declared... no
checking whether AI_NUMERICSERV is declared... no
checking whether AI_V4MAPPED is declared... no
checking whether IPV6_V6ONLY is declared... no
checking whether IPPROTO_IP is declared... no
checking whether IPPROTO_TCP is declared... no
checking whether IPPROTO_IPV6 is declared... no
checking for sendfile in sys/sendfile.h... no
checking for sendfile in sys/socket.h... no
checking for gethostent... no
checking for accept4... no
configure: creating ./config.status
config.status: creating network.buildinfo
config.status: creating include/HsNetworkConfig.h
configure: WARNING: unrecognized options: --with-compiler
Building network-2.6.3.1...
Preprocessing library network-2.6.3.1...
[1 of 9] Compiling Network.Socket.Types ( .stack-work\dist\b7fec021\build\Network\Socket\Types.hs, .stack-work\dist\b7fec021\build\Network\Socket\Types.o )
NetworkSocketTypes.hsc:828:9: error:
Not in scope: type constructor or class `FlowInfo'
NetworkSocketTypes.hsc:829:9: error:
Not in scope: type constructor or class `HostAddress6'
Perhaps you meant `HostAddress' (line 1004)
NetworkSocketTypes.hsc:830:9: error:
Not in scope: type constructor or class `ScopeID'
I just ran the stack install phoityne-vscode
command from my command prompt. I am using Windows 10. It looks like there may not be windows support, considering it looks for /usr/ and /linux/ files? I have seen some stuff that alludes to windows use, though, so I am not sure.
Not sure what to do, if I can do anything. Some help would be appreciated.
from vscode-1.13.0, can not add binding variable to watch item, on ui.
should support evaluateName attribute...? #14846
After waiting around 1 hour after executing the stack install phoityne-vscode haskell-dap command the installation did not complete. I killed GHC.exe and the following was printed to the terminal.
C:\Users\haava>stack install phoityne-vscode haskell-dap
phoityne-vscode-0.0.28.0: configure
phoityne-vscode-0.0.28.0: build
-- While building package phoityne-vscode-0.0.28.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_2.4.0.1_ghc-8.6.3.exe --builddir=.stack-work\dist\e626a42b build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: C:\sr\global-project.stack-work\logs\phoityne-vscode-0.0.28.0.log
Configuring phoityne-vscode-0.0.28.0...
Preprocessing executable 'phoityne-vscode' for phoityne-vscode-0.0.28.0..
Building executable 'phoityne-vscode' for phoityne-vscode-0.0.28.0..
[ 1 of 107] Compiling Paths_phoityne_vscode ( .stack-work\dist\e626a42b\build\phoityne-vscode\autogen\Paths_phoityne_vscode.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Paths_phoityne_vscode.o )
[ 2 of 107] Compiling Phoityne.GHCi.Process ( app\Phoityne\GHCi\Process.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\GHCi\Process.o )
[ 3 of 107] Compiling Phoityne.GHCi.Command ( app\Phoityne\GHCi\Command.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\GHCi\Command.o )
[ 4 of 107] Compiling Phoityne.GHCi ( app\Phoityne\GHCi.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\GHCi.o )
[ 5 of 107] Compiling Phoityne.VSCode.Constant ( app\Phoityne\VSCode\Constant.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\VSCode\Constant.o )
[ 6 of 107] Compiling Phoityne.VSCode.Type ( app\Phoityne\VSCode\Type.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\VSCode\Type.o )
[ 7 of 107] Compiling Phoityne.VSCode.Argument ( app\Phoityne\VSCode\Argument.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\VSCode\Argument.o )
[ 8 of 107] Compiling Phoityne.VSCode.Utility ( app\Phoityne\VSCode\Utility.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\VSCode\Utility.o )
[ 9 of 107] Compiling Phoityne.VSCode.TH.VariablesArgumentsJSON ( app\Phoityne\VSCode\TH\VariablesArgumentsJSON.hs, .stack-work\dist\e626a42b\build\phoityne-vscode\phoityne-vscode-tmp\Phoityne\VSCode\TH\VariablesArgumentsJSON.o )
OS: Windows 10 64 bit Version 1809 (OS Build 17763-292)
GHC: The Glorious Glasgow Haskell Compilation System, version 8.6.3
Hello,
on Windows when you have a file with a space in the path (e.g. C:\Users\Here is space\main.hs)
then starting debugging (or saving the fail while debugging) will not initialize properly because in ghci> :load C:\Users\Here is space\main.hs will result in error. Adding just quotes does not solve the issue you also have to change the backslashes to slashes. So the command it should run is ghci> :load "C:/Users/Here is space/main.hs".
Can you please fix?
Keep up the good work!
2019-05-16 23:50:04 [ThreadId 3] ERROR phoityne - setBreakpointRequest failed. [DAP][ERROR] loaded module can not find from path. <c:\Users\li\tmp\prettyJSON\Prettify.hs> [("Main","c:/Users/li/tmp/prettyJSON/Main.hs"),("Prettify",".\Prettify.hs"),("PrettyJSON",".\PrettyJSON.hs"),("SimpleJSON",".\SimpleJSON.hs")] : Left "[DAP][ERROR] loaded module can not find from path. <c:\Users\li\tmp\prettyJSON\Prettify.hs> [("Main","c:/Users/li/tmp/prettyJSON/Main.hs"),("Prettify",".\\Prettify.hs"),("PrettyJSON",".\\PrettyJSON.hs"),("SimpleJSON",".\\SimpleJSON.hs")]"
Basically, it is difficult to inspect watch data details,
because phoityen is just a viewer of ghci output.
It is a pretty-printed messages.
Simply saying, vscode expects that ghci speaks debug protocol.
so, adding that functionality to ghci is the best way, imho.
(ghci should know debug data details.)
it is a faraway goal.
anyway, reading ghci and intero code.
from vscode-1.6 release notes,
"Debug adapters can now implement 'hit count' support for breakpoints. "
investigate and going to implements "break by hit count" function.
Despite the videos, the documentation in VSCode seems to lack some basic things like example configurations. Running a VSCode extension is for me more difficult than understanding protofunctoidal arrowized contravariantoids in Haskell.
I got error when I put a break point on "break" function and press F5 until it finishes.
H>>=
""extractSourcePosition" (line 2, column 6):\nunexpected end of input\nexpecting "Stopped at " or "Stopped in " [INPUT]it :: ()\nH>>= "
on code:
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Prelude hiding (break)
import Lib
import Data.Foldable (for_)
import Control.Exception.Base
import Control.Monad (void)
break = fail ""
for cont = void . tr . for_ cont where
tr :: IO () -> IO (Either SomeException ())
tr = try
myfunc = do
print "Cycle from 1 to 9 with break:"
for [1..100] $ \i ->
if i == 10 then
break
else print i
main :: IO ()
main = myfunc
This works fine with stack resolver lts-14.27 but not with lts-15.2 .
$ stack install phoityne-vscode
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Error: While constructing the build plan, the following exceptions were
encountered:
In the dependencies for phoityne-vscode-0.0.28.0:
MissingH needed, but the stack configuration has no specified version
(latest matching version is 1.4.2.1)
needed since phoityne-vscode is a build target.
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps
in /home/dave/.stack/global-project/stack.yaml:
- MissingH-1.4.2.1@sha256:4a3837900f57ee504e762f538fe821de156e88d62ebd3927d33cec9cab05dd45,4269
Plan construction failed.
Hi,
I installed the Haskell GHCi Debug Adapter Phoityne. But the VSCode says 'Debugger Process has terminated unexpectedly' when I tried to start the debugger?
Can I get help to solve this?
Thanks And Best Regards,
Dinesh.
Hi,
After running stack install phoityne-vscode
and adding the executable to my PATH directory in Ubuntu 16.04, VSCode shows the following message: "phoityne-vscode.exe is not found. Run stack install phoityne-vscode
, and put it to PATH environment." Does your extension work on Linux?, am I missing something?
Thanks!
Using vscode 1.18.1, I'm trying to setup the extension and can't tell how to proceed:
true
.Could you make it possible to use phoityne without adding to path? For example by calling stack exec
?
can not set breakpoint on vscode-1.20.0
with phoityne-vscode-0.0.20.0
It would be nice to install this project with nix instead of stack.
When I'm trying to set a breakpoint:
H>>=
Now, ghci launched and configuration done.
Press F5 to start debugging.
Or modify source code. it will be loaded to ghci automatically.
H>>=
:break .Main 22
<interactive>:1:2: error: parse error on input `Main'
Instead of breakpoint, there is a grayed circle shown, with following messages:
unexpected break set result. "getBreakId" (line 3, column 6): unexpected end of input expecting "Breakpoint "
<interactive>:1:2: error: parse error on input `Main' H>>=
In the log file, there are only messages related to deleting such incomplete breakpoints:
2017-02-13 01:21:33 [ThreadId 3] ERROR phoityne - [deleteBreakPointOnGHCi] invalid delete break point. BreakPointData {nameBreakPointData = ".Main", filePathBreakPointData = "c:\\...\\Main.hs", lineNoBreakPointData = 17, breakNoBreakPointData = Nothing, conditionBreakPointData = Nothing, hitConditionBreakPointData = Nothing, hitCountBreakPointData = 0}
Main.hs contains "module Main where" line.
Windows 10
VSCode 1.9.1
GHC 8.0.1, stack 1.3.2
Haskell GHCi debug viewer Phoityne - Marketplace phoityne-vscode-0.0.10
For me it looks like a regression after update - it worked before 2017-02-05.
(Module was also renamed about that day. I don't see how it may affect the things, but mentioned it here just in case.)
set main args by ghci :set args command.
this enhancement has been commited.
vscode: 1.23.1
os: Linux Manjaro
phoityne-vscode extension: 0.0.19.0
phoityne-vscode: 0.0.22.0 / 0.0.23.0
other extensions: haskelly 0.5.4
resolver: lts-10.10
Steps to reproduce:
stack new package-name https://raw.githubusercontent.com/phoityne/stack-project-template/master/type-201711.hsfiles -p "module:Project.Top.Module" -p "module-path:Project/Top/Module" -p "paths-module:Paths_package_name"
Select haskell-debug-adapter
Set a breakpoint
hit F5
spawn EACCES pops up
nothing happens after it
launch.json:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "ghc",
"name": "haskell-debug-adapter",
"request": "launch",
"internalConsoleOptions": "openOnSessionStart",
"workspace": "${workspaceRoot}",
"startup": "${workspaceRoot}/test/Spec.hs",
"startupFunc": "",
"startupArgs": "",
"stopOnEntry": true,
"mainArgs": "",
"ghciPrompt": "H>>= ",
"ghciInitialPrompt": "Prelude>",
"ghciCmd": "stack ghci --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show",
"ghciEnv": {},
"logFile": "${workspaceRoot}/.vscode/phoityne.log",
"logLevel": "WARNING"
}
]
}
When I run a simple little program like:
module Main where
sqr :: Integer -> Integer
sqr x = x * x
main :: IO ()
main = do
putStrLn $ show (sqr 5)
getLine >>= putStrLn
putStrLn $ show (sqr 10)
Then:
(a) The debugger will only display the result of the first putStrLn action if I have a breakpoint on the getLine.
(b) GHCi doesn't seem to return after taking input from the getLine.
Thanks for the extension!
Everything current. MacOS Mojave 10.14.4, Xcode-10.2.1, current VSCode, current stable phoityne-vscode
extension installed via VSCode Extensions (I did not rebuild it).
stack install phoityne-vscode
fails:
$ stack install phoityne-vscode
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for free-4.12.4:
base-4.12.0.0 from stack configuration does not match ==4.* && <4.11 (latest matching version
is 4.10.1.0)
containers-0.6.0.1 from stack configuration does not match <0.6 (latest matching version is 0.5.11.0)
needed due to phoityne-vscode-0.0.28.0 -> free-4.12.4
Some different approaches to resolving this:
* Set 'allow-newer: true'
in /Users/ur20980/.stack/config.yaml to ignore all version constraints and build anyway.
* Consider trying 'stack solver', which uses the cabal-install solver to attempt to find some working
build configuration. This can be convenient when dealing with many complicated constraint errors, but
results may be unpredictable.
* Build requires unattainable version of base. Since base is a part of GHC, you most likely need to use a
different GHC version with the matching base.
Plan construction failed.
$
After setting allow-newer: true
in ~/.stack/config.yaml
:
$ stack install phoityne-vscode
WARNING: Ignoring out of range dependency (allow-newer enabled): base-4.12.0.0. free requires: ==4.* && <4.11
WARNING: Ignoring out of range dependency (allow-newer enabled): containers-0.6.0.1. free requires: <0.6
free-4.12.4: configure
free-4.12.4: build
Progress 1/5
-- While building package free-4.12.4 using:
/Users/ur20980/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_2.4.0.1_ghc-8.6.4 --builddir=.stack-work/dist/x86_64-osx/Cabal-2.4.0.1 build --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
Logs have been written to: /Users/ur20980/.stack/global-project/.stack-work/logs/free-4.12.4.log
Configuring free-4.12.4...
Preprocessing library for free-4.12.4..
Building library for free-4.12.4..
[ 1 of 16] Compiling Control.Alternative.Free ( src/Control/Alternative/Free.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Alternative/Free.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Alternative/Free.hs:34:1: warning: [-Wunused-imports]
The import of ‘Data.Semigroup’ is redundant
except perhaps to import instances from ‘Data.Semigroup’
To import instances alone, use: import Data.Semigroup()
|
34 | import Data.Semigroup
| ^^^^^^^^^^^^^^^^^^^^^
[ 2 of 16] Compiling Control.Alternative.Free.Final ( src/Control/Alternative/Free/Final.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Alternative/Free/Final.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Alternative/Free/Final.hs:25:1: warning: [-Wunused-imports]
The import of ‘Data.Semigroup’ is redundant
except perhaps to import instances from ‘Data.Semigroup’
To import instances alone, use: import Data.Semigroup()
|
25 | import Data.Semigroup
| ^^^^^^^^^^^^^^^^^^^^^
[ 3 of 16] Compiling Control.Applicative.Free ( src/Control/Applicative/Free.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Applicative/Free.o )
[ 4 of 16] Compiling Control.Applicative.Free.Final ( src/Control/Applicative/Free/Final.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Applicative/Free/Final.o )
[ 5 of 16] Compiling Control.Applicative.Trans.Free ( src/Control/Applicative/Trans/Free.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Applicative/Trans/Free.o )
[ 6 of 16] Compiling Control.Comonad.Cofree.Class ( src/Control/Comonad/Cofree/Class.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Comonad/Cofree/Class.o )
[ 7 of 16] Compiling Control.Comonad.Cofree ( src/Control/Comonad/Cofree.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Comonad/Cofree.o )
[ 8 of 16] Compiling Control.Comonad.Trans.Cofree ( src/Control/Comonad/Trans/Cofree.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Comonad/Trans/Cofree.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Comonad/Trans/Cofree.hs:46:1: warning: [-Wunused-imports]
The import of ‘Data.Semigroup’ is redundant
except perhaps to import instances from ‘Data.Semigroup’
To import instances alone, use: import Data.Semigroup()
|
46 | import Data.Semigroup
| ^^^^^^^^^^^^^^^^^^^^^
[ 9 of 16] Compiling Control.Comonad.Trans.Coiter ( src/Control/Comonad/Trans/Coiter.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Comonad/Trans/Coiter.o )
[10 of 16] Compiling Control.Monad.Free.Class ( src/Control/Monad/Free/Class.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Free/Class.o )
[11 of 16] Compiling Control.Monad.Free.TH ( src/Control/Monad/Free/TH.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Free/TH.o )
[12 of 16] Compiling Control.Monad.Trans.Free ( src/Control/Monad/Trans/Free.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Trans/Free.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Monad/Trans/Free.hs:72:1: warning: [-Wunused-imports]
The import of ‘Data.Monoid’ is redundant
except perhaps to import instances from ‘Data.Monoid’
To import instances alone, use: import Data.Monoid()
|
72 | import Data.Monoid
| ^^^^^^^^^^^^^^^^^^
[13 of 16] Compiling Control.Monad.Free ( src/Control/Monad/Free.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Free.o )
[14 of 16] Compiling Control.Monad.Free.Church ( src/Control/Monad/Free/Church.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Free/Church.o )
[15 of 16] Compiling Control.Monad.Trans.Free.Church ( src/Control/Monad/Trans/Free/Church.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Trans/Free/Church.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Monad/Trans/Free/Church.hs:83:10: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘Eq (FreeT f m a)’ matches an instance declaration
instance [safe] Eq (m (FreeF f a (FreeT f m a))) =>
Eq (FreeT f m a)
-- Defined at src/Control/Monad/Trans/Free.hs:182:1
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• In the context: (Functor f, Monad m, Eq (FreeT f m a))
While checking an instance declaration
In the instance declaration for ‘Eq (FT f m a)’
|
83 | instance (Functor f, Monad m, Eq (FreeT f m a)) => Eq (FT f m a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Monad/Trans/Free/Church.hs:86:10: warning: [-Wsimplifiable-class-constraints]
• The constraint ‘Ord (FreeT f m a)’
matches an instance declaration
instance [safe] Ord (m (FreeF f a (FreeT f m a))) =>
Ord (FreeT f m a)
-- Defined at src/Control/Monad/Trans/Free.hs:187:1
This makes type inference for inner bindings fragile;
either use MonoLocalBinds, or simplify it using the instance
• In the context: (Functor f, Monad m, Ord (FreeT f m a))
While checking an instance declaration
In the instance declaration for ‘Ord (FT f m a)’
|
86 | instance (Functor f, Monad m, Ord (FreeT f m a)) => Ord (FT f m a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[16 of 16] Compiling Control.Monad.Trans.Iter ( src/Control/Monad/Trans/Iter.hs, .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/Control/Monad/Trans/Iter.o )
/private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/stack97833/free-4.12.4/src/Control/Monad/Trans/Iter.hs:391:10: error:
• Could not deduce (Semigroup (IterT m a))
arising from the superclasses of an instance declaration
from the context: (Monad m, Monoid a)
bound by the instance declaration
at src/Control/Monad/Trans/Iter.hs:391:10-50
• In the instance declaration for ‘Monoid (IterT m a)’
|
391 | instance (Monad m, Monoid a) => Monoid (IterT m a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$
And without this installed, VSCode complains about "broken pipe" communicating with GHCi.
In the project directory:
$ stack test
Str3Split-0.1.0.0: test (suite: Str3Split-test)
Phoityne.Example.Math
sumGs
with [1..10]
should be 55
with [10..1]
should be 55
with [1..1
should be 0
Finished in 0.0005 seconds
3 examples, 0 failures
Str3Split-0.1.0.0: Test suite Str3Split-test passed
$ stack exec haskell-dap -- --interactive
[DAP][INFO] start haskell-dap-0.0.13.0.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude> putStrLn "Testing"
Testing
Prelude>
Leaving GHCi.
$ stack ghci --with-ghc=haskell-dap
Using main module: 1. Package `Str3Split' component exe:Str3Split-exe with main-is file: /Users/ur20980/src/Str3Split/app/Main.hs
The following GHC options are incompatible with GHCi and have not been passed to it: -threaded -Werror -O2
Configuring GHCi with the following packages: Str3Split
[DAP][INFO] start haskell-dap-0.0.13.0.
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
[1 of 3] Compiling Lib ( /Users/ur20980/src/Str3Split/src/Lib.hs, interpreted )
[2 of 3] Compiling Main ( /Users/ur20980/src/Str3Split/app/Main.hs, interpreted )
[3 of 3] Compiling Phoityne.Example.Math ( /Users/ur20980/src/Str3Split/src/Phoityne/Example/Math.hs, interpreted )
Ok, three modules loaded.
Loaded GHCi configuration from /private/var/folders/c6/lnc_0m093ys8w16md_fm1mnxhtfnj8/T/haskell-stack-ghci/6f615862/ghci-script
*Main Lib Phoityne.Example.Math> putStrLn "Testing"
Testing
*Main Lib Phoityne.Example.Math>
Leaving GHCi.
2019-05-07 16:28:30 [ThreadId 23] ERROR phoityne - ghci launch error. <file descriptor: 120>: hPutChar: resource vanished (Broken pipe)
2019-05-07 16:28:30 [ThreadId 23] ERROR phoityne - [disconnectRequestHandler] ghci not started.
2019-05-07 16:29:18 [ThreadId 23] ERROR phoityne - ghci launch error. <file descriptor: 120>: hPutChar: resource vanished (Broken pipe)
2019-05-07 16:29:18 [ThreadId 23] ERROR phoityne - [disconnectRequestHandler] ghci not started.
2019-05-07 16:29:47 [ThreadId 23] ERROR phoityne - ghci launch error. <file descriptor: 120>: hPutChar: resource vanished (Broken pipe)
2019-05-07 16:29:47 [ThreadId 23] ERROR phoityne - [disconnectRequestHandler] ghci not started.
2019-05-07 16:31:01 [ThreadId 23] ERROR phoityne - ghci launch error. <file descriptor: 120>: hPutChar: resource vanished (Broken pipe)
2019-05-07 16:31:01 [ThreadId 23] ERROR phoityne - [disconnectRequestHandler] ghci not started.
[CRITICAL]<launch> request parce error.
Content-Length: 545
{"command":"launch","arguments":{"type":"ghc","request":"launch","name":"main-haskell-debug-adapter","startup":"/Users/ur20980/src/Str3Split/app/Main.hs","ghciCmd":"stack ghci --with-ghc=haskell-dap --test --no-load --no-build --main-is TARGET --ghci-options -fprint-evld-with-show","mainArgs":"","ghciPrompt":"H>>= ","ghciInitialPrompt":"Prelude>","ghciEnv":{},"logFile":"/Users/ur20980/src/Str3Split/.vscode/phoityne.log","logLevel":"WARNING","forceInspect":false,"__sessionId":"7f1dbdc5-e73f-468b-a904-40fe66542165"},"type":"request","seq":2}
"Error in $.arguments: When parsing the record LaunchRequestArguments of type Phoityne.VSCode.TH.LaunchRequestArgumentsJSON.LaunchRequestArguments the key workspace was not present."
`stack update` and install new phoityne-vscode.
Or check information on https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode
[disconnectRequestHandler] ghci not started.
Exception has occurred.
_exception = GHC.Exception.SomeException
(/Users/abraham/.hspec: getFileStatus: does not exist (No such file or directory))
GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help
Prelude>:set prompt "<<DAP_CMD_END2>>\nH>>= "
H>>= :set prompt-cont "<<DAP_CMD_END2>>\nH>>= "
H>>= :dap-launch ...
H>>= :load /home/devina/Documents/docck/proof.hs
[1 of 1] Compiling Dissertation ( /home/devina/Documents/docck/proof.hs, interpreted )
/home/devina/Documents/docck/proof.hs:4:3: error:
Could not find module ‘Data.List.Split’
Use -v (or :set -v
in ghci) to see a list of the files searched for.
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/Geometry/Cuboid.hs> [])
:dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/hs.hs> [])
:dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/hs.hs> [])
:dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/k.hs> [])
:dap-set-breakpoints ...
H>>= [ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/proof.hs> [])
:dap-continue ...
:10:1: error:
• Variable not in scope: main
• Perhaps you meant ‘min’ (imported from Prelude)
H>>=
start debugging failed. user error (ExecResult not found.) : Left "user error (ExecResult not found.)"
How to fix this error?
i Could not find module ‘Data.List.Split’
and
[ERROR][APP] user error (loaded module can not find from path. </home/devina/Documents/docck/Geometry/Cuboid.hs> [])
??
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.