Skip to content

Commit cd47f3b

Browse files
authored
Fix -Wall and -Wunused-packages in module name and overloaded record dot plugins (#4009)
* Fix -Wall and -Wunused-packages in module name and overloaded record dot plugins * undo import change to make stylish-haskell succeed
1 parent d6553e0 commit cd47f3b

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

Diff for: plugins/hls-module-name-plugin/hls-module-name-plugin.cabal

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ source-repository head
2323
type: git
2424
location: https://github.com/haskell/haskell-language-server.git
2525

26+
common warnings
27+
ghc-options: -Wall -Wunused-packages
28+
2629
library
30+
import: warnings
2731
exposed-modules: Ide.Plugin.ModuleName
2832
hs-source-dirs: src
2933
build-depends:
@@ -37,11 +41,11 @@ library
3741
, lsp
3842
, text
3943
, transformers
40-
, unordered-containers
4144

4245
default-language: Haskell2010
4346

4447
test-suite tests
48+
import: warnings
4549
type: exitcode-stdio-1.0
4650
default-language: Haskell2010
4751
hs-source-dirs: test

Diff for: plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{-# LANGUAGE OverloadedStrings #-}
33
{-# LANGUAGE PatternSynonyms #-}
44
{-# LANGUAGE RecordWildCards #-}
5-
{-# LANGUAGE TypeOperators #-}
65
{-# LANGUAGE ViewPatterns #-}
76

87
{-# OPTIONS_GHC -Wall -Wwarn -fno-warn-type-defaults #-}
@@ -133,7 +132,7 @@ action recorder state uri = do
133132
| emptyModule ->
134133
let code = "module " <> bestName <> " where\n"
135134
in pure [Replace uri (Range (Position 0 0) (Position 0 0)) code code]
136-
_ -> pure $ []
135+
_ -> pure []
137136

138137
-- | Possible module names, as derived by the position of the module in the
139138
-- source directories. There may be more than one possible name, if the source

Diff for: plugins/hls-module-name-plugin/test/Main.hs

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ tests =
5555
let edit = TextEdit (mkRange 1 0 1 0) "f ="
5656
_ <- applyEdit doc edit
5757
newLens <- getCodeLenses doc
58-
txt <- documentContents doc
5958
liftIO $ newLens @?= oldLens
6059
closeDoc doc
6160
]

Diff for: plugins/hls-overloaded-record-dot-plugin/hls-overloaded-record-dot-plugin.cabal

+1-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source-repository head
1919
location: https://github.com/haskell/haskell-language-server
2020

2121
common warnings
22-
ghc-options: -Wall
22+
ghc-options: -Wall -Wunused-packages
2323

2424
library
2525
import: warnings
@@ -35,8 +35,6 @@ library
3535
, text
3636
, syb
3737
, transformers
38-
, ghc-boot-th
39-
, unordered-containers
4038
, containers
4139
, deepseq
4240
hs-source-dirs: src
@@ -51,13 +49,7 @@ test-suite tests
5149
build-depends:
5250
, base
5351
, filepath
54-
, ghcide
5552
, text
5653
, hls-overloaded-record-dot-plugin
57-
, hls-plugin-api
58-
, lens
59-
, lsp-test
60-
, lsp-types
61-
, row-types
6254
, hls-test-utils
6355

0 commit comments

Comments
 (0)