Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect stack elsewhere than the project root #1763

Open
kendfrey opened this issue Dec 29, 2020 · 3 comments
Open

Detect stack elsewhere than the project root #1763

kendfrey opened this issue Dec 29, 2020 · 3 comments
Labels
build tool: stack can-workaround component: hie-bios level: hard Ticket suited for experts status: needs info Not actionable, because there's missing information type: enhancement New feature or request

Comments

@kendfrey
Copy link

My project structure is such that my Haskell app is in a subfolder and not the project root. For example:

my-haskell-app/stack.yaml
my-haskell-app/package.yaml
my-haskell-app/src/etc...
README.md
etc...

When I open vscode to my project root I get a message like this:

haskell-language-server 0.7.1 for GHC 8.4.3 is not available on Windows_NT

From what I can tell, it's trying to use the system GHC installation instead of stack. Opening the subfolder my-haskell-app in vscode gets it to download the correct version of haskell-language-server.

The Haskell extension should work with stack projects that are not directly in vscode's workspace root directory.

@fendor
Copy link
Collaborator

fendor commented Dec 30, 2020

This is not easily possible, since we need to launch the correct HLS version before a real Haskell file is opened.
And the correct HLS version needs to know which ghc version you are using on the project, to launch a HLS version that has been compiled with the same ghc version.

A quick work-around is to add a top-level stack.yaml file, e.g.

resolver: ... # Not sure if required
packages: ./my-haskell-app

with which we can detect the right tool.

@jneira
Copy link
Member

jneira commented Jan 11, 2021

@kendfrey have you got the opportunity of trying the suggested workaround?

@kendfrey
Copy link
Author

@kendfrey have you got the opprtunity of try the suggested workaround?

No I haven't used that workaround.

@jneira jneira transferred this issue from haskell/vscode-haskell Apr 19, 2021
@jneira jneira added component: hie-bios type: enhancement New feature or request type: setup can-workaround status: needs info Not actionable, because there's missing information labels Apr 19, 2021
@Ailrun Ailrun added level: hard Ticket suited for experts and removed old_type: setup labels Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack can-workaround component: hie-bios level: hard Ticket suited for experts status: needs info Not actionable, because there's missing information type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants