-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Working directory in multi-component project #1584
Comments
Duplicate, I think: #481 |
mmm i think that one only was reproduced using stack but no cabal 🤔 |
Yup, if I change my
I also tried
|
Yeah, I vaguely remember it being an issue that cabal and stack don't even agree on this. |
I think I remember having similar problem with |
Using |
I don't see that there is a realistic prospect of "fixing" this within HLS because of the fundamental issue that We should instead off an API in template-haskell which allows the user to implement a non-hacky version of |
I'm going to close this as wontfix, since I think we're not going to do anything here. |
Your environment
Output of
haskell-language-server --probe-tools
orhaskell-language-server-wrapper --probe-tools
:$ haskell-language-server-8.10.4 --probe-tools haskell-language-server version: 1.0.0.0 (GHC: 8.10.4) (PATH: /home/dc/.ghcup/bin/haskell-language-server-8.10.4~1.0.0) (GIT hash: 4cd1cf934638881e52b3eba9f70157a4b799c0e9) Tool versions found on the $PATH cabal: 3.4.0.0 stack: 2.5.1 ghc: 8.10.4
Which lsp-client do you use: VS code
Describe your project (alternative: link to the project):
Contents of
hie.yaml
:Steps to reproduce
I've created a demo repo here: https://github.com/dcastro/hls-working-dir
It's a multi-component repo, with
cabal.project
/stack.yaml
at the root, and then two components in./code/first
and./code/second
.Main
module contains a TH splice that displays the working directory used while compiling the project/home/dc/dev/other/hls-working-dir
stack build
/cabal build all
/home/dc/dev/other/hls-working-dir/code/first
Expected behaviour
I expected both HLS, stack and cabal to report the same working dir.
Actual behaviour
HLS uses a different working dir than stack and cabal.
This means that any TH code that reads files from the filesystem will show up as an error in HLS, but compile successfully with stack/cabal.
Include debug information
Execute in the root of your project the command
haskell-language-server --debug .
and paste the logs here:Debug output:
Paste the logs from the lsp-client, e.g. for VS Code
LSP logs:
The text was updated successfully, but these errors were encountered: