-
Notifications
You must be signed in to change notification settings - Fork 239
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
Provide haskell-language-server-wrapper
to help direnv
#1776
Comments
I have tried to adapt this: #1012 (comment)
It does not work; the difference being this project uses Hix.
Is there a way to make this work? Thank you |
I think this is my preferred solution, and I'm not sure why you don't like it. You're already using You can also use emacs' support for directory-local variables to change the value of
|
Thanks for the quick response. If this workaround were included in Instead of having This could reduce the barrier for multiple editors to have full HLS support using only the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
HLS is such a necessity that supporting a simple setup is crucial for making a toolset have decent DX. Here's what we're using with plain
|
I think this can/should be fixed on the client side. I opened haskell/vscode-haskell#845 for the vscode extension. |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
haskell-tools.nvim has a similar issue. It seems odd to try and fix all the tools that have an expectation of the wrapper being available when that's what has been the standard. It would be so easy to fix this in haskell.nix and lower the barrier to entry for people trying out haskell.nix and/or HLS for the first time. Update: raised mrcjkb/haskell-tools.nvim#233 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is your feature request related to a problem? Please describe.
I am using a
haskell.nix
Flake, Haskell Language Server,direnv
, Emacs, andenvrc
for Emacs.I am trying to make the
haskell.nix
Flake provide HLS to Emacs. I don't want Emacs to use/home/peterbecich/.ghcup/bin/haskell-language-server-9.2.4
.lsp-haskell
for Emacs launches HLS. By default it looks forhaskell-language-server-wrapper
; nothaskell-language-server
,haskell-language-server-9.2.4
, etc. :https://github.com/emacs-lsp/lsp-haskell/blob/485c1148ce4d27030bb95b21c7289809294e7d31/lsp-haskell.el#L220-L225
Here is an example project which uses a
haskell.nix
Flake to provide Haskell Language Server in thenix develop
shell: https://github.com/peterbecich/halogen-chessand the relevant configuration for that:
https://github.com/peterbecich/halogen-chess/blob/7b295327f9503fe7db09b6f7c2bbc50539c601a5/flake.nix#L195-L200
If I open
nix develop
and look for HLS, here is the binary provided byhaskell.nix
:Here is the binary
haskell-language-server-wrapper
which will be found bylsp-haskell
:The critical error is that
haskell-language-server-wrapper
then fails to point back to the Nix HLS binary; instead it points to/home/peterbecich/.ghcup/bin/haskell-language-server-9.2.4
.Looking at the HLS code, if these two strings in
candidates'
were reversed, perhaps it would work correctly, I'm not sure:https://github.com/haskell/haskell-language-server/blob/85f788135175a007d3db4ac911c4115b30ab9d87/exe/Wrapper.hs#L150-L153
Describe the solution you'd like
When
haskell.nix
is configured to providehaskell-language-server
in thenix develop
shell, it should also provide thehaskell-language-server-wrapper
binary. The result would be something like:I am assuming the Nix
haskell-language-server-wrapper
would then point to the Nixhaskell-language-server
.Describe alternatives you've considered
lsp-haskell
has a configuration option to point to a different HLS binary:This actually fixes the issue. My preference is this would be solved in
haskell.nix
and not in the LSP clients for Emacs and other editors.Thank you!
Additional context
The text was updated successfully, but these errors were encountered: