-
-
Notifications
You must be signed in to change notification settings - Fork 390
HLS suggests quick fixes but cannot apply them #3241
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
Comments
Can you be more specific about the action that fails and get us the logs, ideally in debug mode? |
Sure. When I initiate a code action, and select the "Apply hint" option: It throws these errors:
This is the debug output in hls.log:
|
That is quite odd. |
I seem to have the same problem as well on Fedora. It is quite odd because everything else seems to work besides the quick fixes. |
Does |
Same issue for me, |
Same here on HLS 1.8.0.0, GHC 9.2.4, hlint v3.5 and refactor v0.10.0.0. I'm using Emacs with eglot as an LSP client. Eglot reports this exchange of messages with HLS:
I added some lines for clarity. I hope this helps. |
Aha! That reveals a suspicious line:
So maybe this is an installation problem? @hasufell do you know what might cause this? |
It sounds like maybe something is compiling in the location of a GHC settings file and somehow getting the absolute path to where it was on the gitlab builder that build the bindist 🤔 |
I don't know. This is something to ask the GHC folks @mpickering @bgamari |
Is there something in HLS depending on |
(I tried putting |
Subscribing since I am experiencing the same problem. Note that everything works with ghc 8.10.7 and not with 9.2.4. Also for me the error is
hls 1.8.0.0 and ghc 9.2.4 as installed via ghcup |
If any of you who have this problem have the time, it would be interesting to know whether the problem persists when you tell ghcup to compile HLS for you instead of using the bindist. Hopefully that would pin it down to a bindist problem. |
Compiling from source ( |
I tried a slightly different approach (compiling the released version rather than master) and I am surprised I cannot even get an install plan (hls 1.8 as released on hackage).
(This is the same error you get with |
Compiling |
Just tried |
HLS-hlint-plugin and any other plugins that use libdir need this fix: #3120 (comment) |
Ok, so this is not a bindist problem but a 1.8.0.0 bug with ghc 9.2 (that seems to be fixed on master).
|
It's not fixed on master, only one plugin is doing the right thing |
But above it's reported that building from master works. It must still be related to bindists. |
My possibly wrong understanding is that many of the plugins access the GHC libdir in a way that is fragile, in that it works if the build GHC is available at runtime (e.g. if you compile it yourself) and not if it isn't (e.g. if you have a bindist). So we need to fix the plugins to be less fragile, it's not a problem with the bindist process. Fortunately we have an example of doing it right that we can copy, which Pepe pointed to. |
I had the same issue on linux with vscode and ghc 9.4.2. Compiling from master as in #3241 (comment) solved it. More specifically I used HEAD the date of #3241 (comment):
|
I'm getting the same issue with VS Code in W11 under WSL. Reinstalling HLS 1.8.0.0 via GHCup has had no effect.
That file path looks awfully suspicious considering I'm running under WSL, as it should be edit: running |
|
FWIW, I have had the same problem yesterday, with ghcup version v0.1.18.0, stack Version 2.9.1, HLS 1.9.0.0, ghc 9.2.5 all installed via ghcup. Forcing the compilation of hls 1.9 with the above stanzas did fix the issue. |
Just wanted to add that the forced compilation trick also worked for me on macOS 13.1 and
|
The above worked for me after running
) |
If I try to apply code actions in brick/src, hls-1.9.0.0 fixes the issue. However, if I try to apply code actions in brick/programs, HLS still shows me ReactorMessageActionException. You should try applying code actions in https://github.com/jtdaugherty/brick/tree/master/programs Enable demos flag with |
I think the issue was probably fixed for cabal library, but it still exists for cabal executables. |
I'm getting this error as well, using either VSCode or neovim. Manually installing it works fine, but is a hassle I'd rather avoid as the tooling I use in e.g. neovim automatically installs a version that doesn't work. |
Weird, I was expecting this to go away when a new version was released but seems that 1.9.0.0 didn't do the trick. What needs to be done in order for this to work out of the box rather than requiring the workaround? |
On Ubuntu 20.04.5 LTS (x86_64) I have the same problem with all the latest tools from
Applying quickfix in VSCode gives the following in the log:
After forcing
|
What operating systems are you people on? |
Sorry should have mentioned that. I'm running Ubuntu 20.04.5 LTS x86_64 |
I can reproduce with 9.4.4 and 9.2.5, but not with 8.10.7. |
I am on Gentoo Linux. |
Thanks, @fendor identified the issue. It's platform agnostic (although I'm not sure if windows is affected in the same way). |
Still doesn't work on Windows 10. |
A fix will most likely ship with the next release, in the current release, this issue will persist. To fix it for you locally, you may build hls from source via ghcup |
I think we should do a point release. |
Sorry for asking this, but can I get ETA for a fix? This is slightly annoying but not worthy enough for me to justify build from source. |
We're volunteers. Whenever we feel like. I'm currently rewriting the CI and I hope releases will get easier that way. |
Am I missing something? The fix suggested in this thread is a two-liner. It probably took you longer to write this comment than it would've taken you to build from source. |
So, will this be automatically fixed when we get a new release of haskell language server? |
Yes, it should be! |
Your environment
Steps to reproduce
Write any code that HLS will suggest a quick fix for, such as: f x = id x.
Expected behaviour
HLS should suggest a quick fix, then apply the change after selecting the quick fix.
Actual behaviour
HLS offers the appropriate code actions, but quick fixes throw errors instead of applying the changes to the code. Other code actions, such as "Ignore hint ... in this module" still work. Other HLS features also work.
I have tested this with both Emacs LSP packages as well as VSCode, with identical results in all three cases.
Debug information
Error condition, please check your setup and/or the issue tracker: ReactorMessageActionException ExitFailure 1
The text was updated successfully, but these errors were encountered: