phoityne / hdx4vsc

Haskell Debugger Extension for Visual Studio Code.

Home Page:https://marketplace.visualstudio.com/items?itemName=phoityne.phoityne-vscode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when path contains spaces

anafvana opened this issue · comments

commented

I've been having trouble running the debugger, and found this one specific error which I believe is a bug:

H>>= :load /Users/a/<anonymised>/Independent Studies/<anonymised>/app/Main.hs
target ‘/Users/a/<anonymised>/Independent’ is not a module name or a source file
Full output
Configuration read.
Starting GHCi.
Wait for a moment.

CWD: /Users/a/<anonymised>/Independent Studies/<anonymised>
CMD: stack ghci --with-ghc=ghci-dap --test --no-load --no-build --main-is TARGET

Now, waiting for an initial prompt("Prelude>") from ghci.


Note: No local targets specified, so a plain ghci will be started with no package hiding or package
      options.

      You are using snapshot: ghc-8.10.4

      If you want to use package hiding and options, then you can try one of the following:

      * If you want to start a different project configuration
        than /Users/a/.stack/global-project/stack.yaml, then you can use stack init to create a new
        stack.yaml for the packages in the current directory.

      * If you want to use the project configuration
        at /Users/a/.stack/global-project/stack.yaml, then you can add to its 'packages' field.

Configuring GHCi with the following packages:
[DAP][INFO] start ghci-dap-0.0.20.0.
GHCi, version 8.10.4: 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 /Users/a/<anonymised>/Independent Studies/<anonymised>/app/Main.hs
target ‘/Users/a/<anonymised>/Independent’ is not a module name or a source file
H>>= :dap-context-modules ...
H>>= :dap-set-function-breakpoints ...
H>>= :dap-continue ...

<interactive>:7: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.)"
:quit
Leaving GHCi.

As you can see, the target gets cut when it meets a space character in the path.

I tried to move the project elsewhere, to a path with no spaces, and no longer got the target error. It might also be relevant to mention I am running MacOS 13.0.1

PS: I am still not able to use the debugger even after moving the project, but this time due to a timeout. Regardless, I am reporting the space character issue, as I believe it is a bug in itself.

Hi.

Could you set the startup value(double-quoted) in the launch.json ?

"startup": "\"${workspaceFolder}/app/Main.hs\"",

Regards.