haskell / haskell/haskell-language-server
-Wno-safe doesn't work
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 11
Description
### Your environment
Which OS do you use: ManjaroOs - 5.15.28-1
Which LSP client (editor/plugin) do you use: VS Code + vscode-haskell + builded from source hls
Describe your project (alternative: link to the project): https://github.com/AbsoluteNikola/hls-warnings-bug
### Steps to reproduce
Clone repo and open Main.hs
I added these ghc options in cabal file: `-Weverything -Wno-safe -Wno-missing-safe-haskell-mode -Wno-implicit-prelude -Wno-missing-export-lists`
I tested on the latest master of hls and 2 different ghc 8.10.7 and 9.0.2. Every time the same issue
### Expected behavior
HLS should work the same with and without this pragma

HLS should not show a warning as below because it was disabled in cabal
```
‘Main’ has been inferred as unsafe!
Reason:
: warning: Use of plugins makes the module unsafe
```
### Actual behaviour
HLS show this warning when `-Wno-safe` in cabal file. With other warnings everything works correctly

### Include debug information
I didn't find any useful information in the log, but maybe it will be helpful for you
[hls.log](https://github.com/haskell/haskell-language-server/files/8456810/hls.log)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.