-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
HLS ignores GHC plugins #3299
Comments
I think source plugins don't work, see e.g. #2779 I don't think anyone particularly knows why though. It probably needs a plugin champion! |
Ah, I suppose this is a duplicate ticket then and can be closed? (Edit: Maybe not though, since the error is quite different) I'm writing a plugin at the moment and am definitely considering fixing this after I'm done, so the plugin will actually be useful. Not sure yet if I'll be able to figure how out, though. |
Issue is likely caused by us invoking the GHC API incorrectly 🙃 https://github.com/haskell/haskell-language-server/blob/master/ghcide/src/Development/IDE/Core/Compile.hs#L572 Since GHC 9.0, Plugins have moved to HscEnv from DynFlags, but we don't modify the HscEnv correctly, it seems to be a mistake from #2128 |
Since ghc 9.0, plugins are stored in the HscEnv, not in the DynFlags. This caused HLS not to run source plugins anymore. This commit fixes that. Fixes haskell#3299 and haskell#2779.
Since ghc 9.0, plugins are stored in the HscEnv, not in the DynFlags. This caused HLS not to run source plugins anymore. This commit fixes that. Fixes haskell#3299 and haskell#2779.
Since ghc 9.0, plugins are stored in the HscEnv, not in the DynFlags. This caused HLS not to run source plugins anymore. This commit fixes that. Fixes haskell#3299.
Since ghc 9.0, plugins are stored in the HscEnv, not in the DynFlags. This caused HLS not to run source plugins anymore. This commit fixes that. Fixes #3299.
Your environment
Ubuntu (under Windows 11 WSL)
ghc 9.4.2 via ghcup
Reproduction repo with minimal example:
https://github.com/JakobBruenker/plugin-test
Which LSP client (editor/plugin) do you use?
VS Code, but running haskell-language-server outside of it produces the same error
Which version of HLS do you use and how did you install it?
1.8.0.0 via ghcup
Have you configured HLS in any way (especially: a hie.yaml file)?
No (though an hie.yaml file generated via implicit-hie seemed to make no difference)
Steps to reproduce
Clone the reproduction repo linked above and run
haskell-language-server
insidejust-some-project
.NB: Because of #3297, this does not work if you run HLS in the top-level directory
plugin-test
.Expected behaviour
There should be no errors, since the plugin replaces
puStrLn
withputStrLn
.Actual behaviour
HSL shows the error
Even though the plugin changes the name to
putStrLn
, which meanscabal run
works just fine.Strangely, I seem to remember doing something similar 6 months ago and it worked, but now I can't get it to work with 9.2 either, but it may have been a different kind of plugin.
The text was updated successfully, but these errors were encountered: