Skip to content

stackYaml support in hie.yaml #375

Closed
@konn

Description

@konn

Subject of the issue

It seems that precompiled binary (at least for GHC 8.6.5) doesn't accept stackYaml configuration item supported by hie-bios >= 0.7, as described in the hie-bios repo.

Your environment

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

    haskell-language-server version: 0.4.0.0 (GHC: 8.6.5) (PATH: ~/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.4.0-darwin-8.6.5) (GIT hash: 0a18edde24923251a148cbbc0ae993a6aac83b9c)
     Tool versions found on the $PATH
     cabal:          3.2.0.0
     stack:          2.3.3
     ghc:            8.6.5
    
  • Which lsp-client do you use: VSCode

  • Describe your project (alternative: link to the project)

    • Include stack.yaml and stack-prof.yaml
  • Contents of hie.yaml:

    cradle:
      stack:
        stackYaml: stack-prof.yaml
        components:
          - path: "src"
            component: "hie-fail-test:lib"
          - path: "app/Main.hs"
            component: "hie-fail-test:exe:hie-fail-test-exe"
          - path: "test"
            component: "hie-fail-test:test:hie-fail-test-test"
    

Steps to reproduce

  1. stack new hie-fail-test

  2. Create a copy stacl-prof.yaml which has an identical contents as stack.yaml

  3. Create a hie.yaml with the above contents

  4. Open, e.g. src/Lib.hs in VSCode

  5. VSCode complains that:

    Couldn't figure out what GHC version the project is using:
    ~/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-wrapper-0.4.0-darwin --project-ghc-version exited with exit code 1:
    
    Found "/path/to/hie-fail-test/hie.yaml" for "/path/to/hie-fail-test/a"
    haskell-language-server-wrapper-0.4.0-darwin: AesonException "Error in $.cradle: Not a valid Configuration type, following keys are allowed: component"
    
  6. or just invoking haskell-language-server-wrapper-0.4.0-darwin, downloaded automatically from GitHub by VSCode, on src/Lib.hs halts with the following error:

    Found "/Users/hiromi/Documents/Programming/Haskell/git/hie-fail-test/hie.yaml" for "/path/to/hie-fail-test/a"
    haskell-language-server-wrapper-0.4.0-darwin: AesonException "Error in $.cradle: Not a valid Configuration type, following keys are allowed: component"
    

Expected behaviour

hls should work properly using the flags/settings in stack-prof.yaml.

Actual behaviour

Doesn't accept stackYaml option at a..

Include debug information

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

Debug output:
Found "/path/to/hie-fail-test/hie.yaml" for "/path/to/hie-fail-test/a"
haskell-language-server-wrapper-0.4.0-darwin: AesonException "Error in $.cradle: Not a valid Configuration type, following keys are allowed: component"

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

LSP logs:
NO LOGS

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions