Open o1lo01ol1o opened 2 months ago
... actually, if I configure an direnv .envrc file:
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi
nix_direnv_watch_file flake.nix
nix_direnv_watch_file flake.lock
DEVENV_ROOT_FILE="$(mktemp)"
printf %s "$PWD" > "$DEVENV_ROOT_FILE"
if ! use flake . --override-input devenv-root "file+file://$DEVENV_ROOT_FILE"
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
fi
and open zed from the command line with zed .
immediately after direnv sources the flake, zed seems to be able to find HLS sometimes.
Given https://github.com/zed-industries/zed/issues/4977#issuecomment-2302406246 - I'd expect the following to work, yet it doesn't.
"lsp": {
"haskell": { "binary": { "path_lookup": true } }
},
Check for existing issues
Describe the bug / provide steps to reproduce it
Using a PATH that contains a custom HLS wrapper (ie, a nix shell) and a GHC version not the same as whatever GHCUp has set, if you have it, you can confirm that HLS works:
Then, confirm that it does not work with zed:
The Haskell extension will complain that it cannot determine the GHC used with this project, and, if you open a zed terminal and execute
haskell-language-server-wrapper
, it will indeed pick the wrong GHC for the project.VSCode has a simple way to handle this:
in .vscode/setttings.json:
Environment
Darwin; zsh.
If applicable, add mockups / screenshots to help explain present your vision of the feature
No response
If applicable, attach your Zed.log file to this issue.
Zed.log