Skip to content
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

Adding {-# OPTIONS_GHC -Wno-all #-} at the top of the file makes HLS cease to report errors, not only warnings. #4349

Open
kindaro opened this issue Jul 6, 2024 · 1 comment
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@kindaro
Copy link

kindaro commented Jul 6, 2024

Your environment

Which OS do you use? ArchLinux.

Which version of GHC do you use and how did you install it? 9.4.8, via ghcup.

How is your project built (alternative: link to the project)? With Cabal.

Which LSP client (editor/plugin) do you use? emacs and lsp-mode.

Which version of HLS do you use and how did you install it? 2.5.0.0, 2.7.0.0, 2.9.0.1, via ghcup.

Have you configured HLS in any way (especially: a hie.yaml file)? No. gen-hie > hie.yaml has no effect.

Steps to reproduce

Create a file like so:

{-# OPTIONS_GHC -Wno-all  #-}

module Example where

f :: Int
f = g

Run haskell-language-server-wrapper Example.hs.

Expected behaviour

g is not in scope; GHC could not compile this file. HLS should show this error to me in the editor and when running from the command line.

Actual behaviour

HLS does not report the error.

Debug information

https://gist.github.com/kindaro/23d8232be484cdd8b650617709d7f355

@kindaro kindaro added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jul 6, 2024
@fendor
Copy link
Collaborator

fendor commented Aug 6, 2024

Hi, thank you for your bug report!

I think this is likely an interaction with -fdefer-type-errors, e.g.

> ghc -fdefer-type-errors Example.hs
[1 of 1] Compiling Example          ( Example.hs, Example.o ) [Source file changed]

I don't think there is much we can do about that.

A potential remedy could be: https://gitlab.haskell.org/ghc/ghc/-/issues/24329

@fendor fendor added component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. and removed status: needs triage labels Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

2 participants