Skip to content

Commit 052b8ae

Browse files
jhrcekmergify[bot]michaelpj
authored
Fix -Wall and -Wunused-packages in change-type-signature plugin (#3970)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Michael Peyton Jones <me@michaelpj.com>
1 parent d4da724 commit 052b8ae

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

plugins/hls-change-type-signature-plugin/hls-change-type-signature-plugin.cabal

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ source-repository head
2222
type: git
2323
location: https://github.com/haskell/haskell-language-server.git
2424

25+
common warnings
26+
ghc-options: -Wall -Wunused-packages
27+
2528
library
29+
import: warnings
2630
exposed-modules: Ide.Plugin.ChangeTypeSignature
2731
hs-source-dirs: src
2832
build-depends:
@@ -34,9 +38,7 @@ library
3438
, syb
3539
, text
3640
, transformers
37-
, unordered-containers
3841
, containers
39-
ghc-options: -Wall
4042
default-language: Haskell2010
4143
default-extensions:
4244
ConstraintKinds
@@ -50,18 +52,17 @@ library
5052

5153

5254
test-suite tests
55+
import: warnings
5356
type: exitcode-stdio-1.0
5457
default-language: Haskell2010
5558
hs-source-dirs: test
5659
main-is: Main.hs
57-
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts -Wall
60+
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts
5861
build-depends:
5962
, base >=4.12 && < 5
6063
, filepath
6164
, hls-change-type-signature-plugin
6265
, hls-test-utils == 2.6.0.0
63-
, lsp
64-
, QuickCheck
6566
, regex-tdfa
6667
, text
6768
default-extensions:

plugins/hls-change-type-signature-plugin/src/Ide/Plugin/ChangeTypeSignature.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ codeActionHandler plId ideState _ CodeActionParams {_textDocument = TextDocument
4646
getDecls :: MonadIO m => PluginId -> IdeState -> NormalizedFilePath -> ExceptT PluginError m [LHsDecl GhcPs]
4747
getDecls (PluginId changeTypeSignatureId) state =
4848
runActionE (T.unpack changeTypeSignatureId <> ".GetParsedModule") state
49-
. (fmap (hsmodDecls . unLoc . pm_parsed_source))
49+
. fmap (hsmodDecls . unLoc . pm_parsed_source)
5050
. useE GetParsedModule
5151

5252
-- | Text representing a Declaration's Name

plugins/hls-change-type-signature-plugin/test/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ goldenChangeSignature fp = goldenWithHaskellDoc def changeTypeSignaturePlugin (f
9595

9696
codeActionTest :: FilePath -> Int -> Int -> TestTree
9797
codeActionTest fp line col = goldenChangeSignature fp $ \doc -> do
98-
void $ waitForDiagnostics -- code actions are triggered from Diagnostics
99-
void $ waitForAllProgressDone -- apparently some tests need this to get the CodeAction to show up
98+
void waitForDiagnostics -- code actions are triggered from Diagnostics
99+
void waitForAllProgressDone -- apparently some tests need this to get the CodeAction to show up
100100
actions <- getCodeActions doc (pointRange line col)
101101
foundActions <- findChangeTypeActions actions
102102
liftIO $ length foundActions @?= 1

0 commit comments

Comments
 (0)