Skip to content

'Couldn't figure out what GHC version the project is using' error on Windows 10 #435

Closed
@MuratOzsoyler

Description

@MuratOzsoyler

I'm getting this error every time I open a project folder:

Couldn't figure out what GHC version the project is using: c:\Users\zmtemp\AppData\Roaming\Code - Insiders\User\globalStorage\haskell.haskell\haskell-language-server-wrapper-1.3.0-win32.exe --project-ghc-version exited with exit code 1: 'c:\Users\zmtemp\AppData\Roaming\Code' is not recognized as an internal or external command, operable program or batch file.

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

> & 'C:\Users\zmtemp\AppData\Roaming\Code - Insiders\User\globalStorage\haskell.haskell\haskell-language-server-wrapper-1.3.0-win32.exe' --probe-tools
haskell-language-server version: 1.3.0.0 (GHC: 8.10.4) (PATH: C:\Users\zmtemp\AppData\Roaming\Code - Insiders\User\globalStorage\haskell.haskell\haskell-language-server-wrapper-1.3.0-win32.exe) (GIT hash: e7c5e90b6df5dff2760d76169eddaea3bdd6a831)  
Tool versions found on the $PATH
cabal:          Not found       
stack:          2.7.1
ghc:            8.6.5

Which OS do you use:
Windows 10 Pro 21H1 19043.1151
Which lsp-client do you use:
VSCode Insiders
Describe your project (alternative: link to the project):
stack.yaml :

resolver: lts-14.27
packages:
- .

sheytan-generate.cabal :

cabal-version: >=1.10
name: sheytan-generate
version: 0.1.0.0
license: BSD3
license-file: LICENSE
copyright: 2020 Author name here
maintainer: example@example.com
author: Author name here
homepage: https://github.com/githubuser/sheytan-generate#readme
category: Web
build-type: Simple
extra-source-files:
    README.md

executable sheytan-generate
    main-is: Main.hs
    hs-source-dirs: src
    other-modules:
        Types
    default-language: Haskell2010
    build-depends:
        base >=4.7 && <5,
        directory -any,
        extra -any,
        regex-applicative -any

Contents of hie.yaml:
No hie.yaml

Steps to reproduce

Just open the project folder and wait for the extension activated. A notification appeared.

Expected behaviour

Extensions supposed to exceute appropirately!

Actual behaviour

I suspect that the space in the Code - Insiders\ directory prevents the relevant command to be executed.

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

Debug output:
& 'C:\Users\zmtemp\AppData\Roaming\Code - Insiders\User\globalStorage\haskell.haskell\haskell-language-server-wrapper-1.3.0-win32.exe' --debug
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper-1.3.0-win32.exe) Version 1.3.0.0, Git revision e7c5e90b6df5dff2760d76169eddaea3bdd6a831 (dirty) x86_64 ghc-8.10.4
Current directory: C:\Users\zmtemp\Desktop\haskell\projects\sheytan-generate
Operating system: mingw32
Arguments: ["--debug"]
Cradle directory: C:\Users\zmtemp\Desktop\haskell\projects\sheytan-generate
Cradle type: Stack

Tool versions found on the $PATH
cabal:          Not found
stack:          2.7.1
ghc:            8.6.5


Consulting the cradle to get project GHC version...
Project GHC version: 8.6.5
haskell-language-server exe candidates: ["haskell-language-server-8.6.5.exe","haskell-language-server.exe"]
Cannot find any haskell-language-server exe, looked for: haskell-language-server-8.6.5.exe, haskell-language-server.exe

Paste the logs from the lsp-client, e.g. for VS Code

LSP logs:
<paste your logs here>

Metadata

Metadata

Assignees

No one assigned

    Labels

    os: windowsWindows related issuestype: bugA bug or unintended effect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions