-
-
Notifications
You must be signed in to change notification settings - Fork 389
Can't get FixIt to add import #4467
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
Hi, thank you for the bug report! Unfortunately, I can not reproduce the described issue on GHC 9.6.6 or 9.8.2. The |
Content of the
is
|
Can you try to execute the CodeAction in your editor while passing these flags to HLS? |
@fendor , would you mind clarifying which flags? |
The flags |
I've passed those options to HLS via the IDE (Vim+YCM); here's the log:
|
Thanks! I am wondering whether this is related to #4451... |
@fendor , would you mind helping understand what I should expect from HLS, in this case? I mean, how can I use it in a standalone way so that I can see what messages it sends to the IDE? I mean, |
It looks like HLS supports Presumably, you can tell your client to log the lsp messages. However, I am not sure how to do that with vim. |
@Aster89 In #4478, I implemented a fallback handler for If you are using |
I just tried. I had my finger crossed for 20 minutes:
but it didn't end well 😢
(Make sure to scroll the snippet above to the right to see all of the message.) |
Thank you for trying! But running something like |
This is the whole output of that very command:
|
I have proof that this should compile fine 😆 https://github.com/haskell/hie-bios/actions/runs/12251791249/job/34177104070 Did you by any chance ever run Also, I have no idea what's going on, I can see that setNoCode :: DynFlags -> DynFlags
#if __GLASGOW_HASKELL__ >= 905
setNoCode d = d { G.backend = G.noBackend }
#else
setNoCode d = d { G.backend = G.NoBackend }
#endif That's a big what? |
There's no way I can prove or confute that I've run that in the past (my memory is just bad). I might assume I have, because
But no, such a file doesn't exist. Or do you mean I should delete one/more/all of the following?
|
Presumably, you should delete all of these (except I have no idea right now why the build of |
Thinking back to your question
and considering that none of those directories is for 9.8.2 nor 9.10.1, the only two versions of GHC installed on my system via GHCup, I assume I could have run that command, but not recently. Anyway, done
|
Hm, and you are sure |
Yeah, I'm pretty sure. (Updated comment above: still got the same errors.) |
Hm, what is the output of |
|
One more idea, can you try to provide the output of |
Here's the output: https://gist.github.com/Aster89/2f5463c6e7c3e10d7b267c1a72fe4ca0 Does it help? 😺 |
Not as much as I hoped... I am out of ideas, your installation seems to be busted one way or another, or there is some global state which we are overlooking and it causes your build to.... do something completely unhinged. I can't explain it at all, but it seems, although you are using setNoCode :: DynFlags -> DynFlags
#if __GLASGOW_HASKELL__ >= 905
setNoCode d = d { G.backend = G.noBackend }
#else
setNoCode d = d { G.backend = G.NoBackend }
#endif Your code reaches the Did you perhaps install a custom
Otherwise, maybe try nuking your ghcup installation Maybe @wz1000 has an idea? |
Your environment
Which OS do you use?
ArchLinux
Which version of GHC do you use and how did you install it?
9.8.2, managed via GHCup
How is your project built (alternative: link to the project)?
Just created a project via
cabal init --simple
, answering2) Executable
to the first and only question.Which LSP client (editor/plugin) do you use?
Terminal Vim + YCM
Which version of HLS do you use and how did you install it?
Should be 2.9.0.1, if I understand correctly (see debug info).
Have you configured HLS in any way (especially: a
hie.yaml
file)?Not that I'm aware of (and log says definitely I don't have a
hie.yaml
file), but please ask specific question if anything makes you think I have.Steps to reproduce
cabal init --simple
,f = when
,FixIt
onwhen
,import Control.Monad (when)
(any other will do I guess)Expected behaviour
import Control.Monad (when)
should be added in the preamble of the file.Actual behaviour
Expected behavior does not happen, and this error is triggered instead:
Debug information
This is the log of the HLS:
The text was updated successfully, but these errors were encountered: