-
Notifications
You must be signed in to change notification settings - Fork 81
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
Usage with haskell-language-server #1560
Comments
To clarify, is this only an issue when you invoke HLS on the command-line so that it tries to load all sources in the current tree, or is it also a problem when you use HLS in your IDE/editor? It sounds like a good solution to this type of issue would be for HLS to be told to ignore certain paths. Perhaps HLS could be instructed to ignore this
Note the |
I tried using the None cradle already but it didn't seem to have any impact. I think the issue might be better suited for haskell-language-server or hie-bios repository since this is mostly related to hie workspace detection. Feel free to close this, I'm however still interested in hearing workarounds from other users. |
Indeed, the ghci wrapper assumes that For the hie-bios files A possible workaround for this specific issue: You could patch the offending file out when importing
Agreed, this is best fixed upstream, e.g. by providing some way to configure paths that should be ignored.
👍 |
Thanks for your pointer related to patching rules_haskell. |
I'm glad to hear that you found a workaround.
Hmm, would removing the The |
Ok, I'll see if I can find something. |
I've opened haskell/hie-bios#299 but I think the problem might be related to the content of .hie-bios (depicted in the linked issue). |
@aherrmann FWIW it seems to work now on our big repo by using the following files:
cradle:
bios:
program: ".hie-bios"
#!/usr/bin/env bash
set -euo pipefail
bazel build :repl --output_groups=hie_bios
ghci_args=$(cat $(bazel info bazel-genfiles)/repl@hie-bios)
ghci_args=$(echo "$ghci_args" | grep -v "k8-fastbuild")
ghci_args=$(echo "$ghci_args" | sed 's|bazel-out|'"$(bazel info output_path)"'|g')
echo -e "$ghci_args" > $HIE_BIOS_OUTPUT We have a repl loading all targets from the project and use it for HLS too now. |
@aveltras Thank you for the update. Right, so the |
Hi,
I'm trying to get a basic project working with a combination of nix and bazel.
Source is available here: https://github.com/aveltras/haskell-bazel-nix/tree/0dbf04db0662dc3e782d34ac4efc1a71f03adc8f
The nix-shell is providing haskell-language-server binary matching GHC.
I'm using the configuration explained here: https://rules-haskell.readthedocs.io/en/latest/haskell-use-cases.html#configuring-ide-integration-with-ghcide
When running "haskell-language-server" in the repo for the first time, it reports "Completed (1 file worked, 0 files failed)" as expected (the one file being the Main.hs in backend directory.
The problem is that, once ran for the first time, bazel add 4 symlinks in the workspace which point to the cache directory in my user directory.
Running "haskell-language-server" then finds 2 hie.yaml (one at the root of my workspace and one by following newly added symlinks until it reaches "external/rules_haskell/hie.yaml" somewhere in bazel cache directory), the second one is obviously not wanted here as the "haskell-language-server" then reports errors for "rules_haskell" code on top of my workspace.
Does anyone have a workaround for this problem ?
The text was updated successfully, but these errors were encountered: