Skip to content

HLS ignores GHC plugins #3299

Closed
Closed
@JakobBruenker

Description

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 inside just-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 with putStrLn.

Actual behaviour

HSL shows the error

  Variable not in scope: puStrLn :: String -> IO ()
  Suggested fix: Perhaps use ‘putStrLn’ (imported from Prelude)

Even though the plugin changes the name to putStrLn, which means cabal 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.

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions